Conditional Logic Not Working on Frontend

Support MB Conditional Logic Conditional Logic Not Working on FrontendResolved

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #27446
    Qu1ntQu1nt
    Participant

    The conditional logic of my form is not working in the frontend. Works fine in the post type page but shows all fields on frontend

    #27457
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Please try to deactivate all plugins except Meta Box, MB extensions and switch to the default theme of WordPress (Twenty TwentyOne) then re-check the issue.

    Get more details on the step Debugging Information https://support.metabox.io/topic/how-to-create-a-new-topic/

    Let me know how it goes.

    #27478
    Qu1ntQu1nt
    Participant

    I am using Twenty TwentyOne Theme and only have oxygen enabled with Metabox, Is oxygen causing the issue?

    #27479
    Qu1ntQu1nt
    Participant

    Getting this error - uncaught referenceerror wp is not defined

    #27482
    Qu1ntQu1nt
    Participant

    So I figured it out, when I remove the post_fields from the shortcode the conditional logic stops working, how do I remove title and content and keep conditional logic?

    I've tried replacing with date, revisions and others but still doesnt work.

    #27525
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Can you please share the code that creates the custom fields, conditional logic, and the frontend shortcode? I will check it on my local site.

    #27980
    JordanJordan
    Participant

    Hi Long,

    I have the exact same issue. Working with Metabox AIO and Oxygen. With post_fields included in the shortcode, conditional logic works fine but as soon as I remove it (or remove "content" and leave "title") it just stops working, displaying the field all the time.

    Here's the shortcode used in Oxygen:
    [mb_frontend_form id="command-form"]

    Here's the code for the conditional logic:
    https://pastebin.com/TfabQPQu

    And the full code for the custom fields:
    https://pastebin.com/eAGrSQBh

    Thanks!

    #27981
    Long NguyenLong Nguyen
    Moderator

    Hi Jordan,

    Please try to use the shortcode in the Block editor or Classic editor. Let me know how it goes.

    #27996
    JordanJordan
    Participant

    Same problem persists without Oxygen.

    #28004
    Long NguyenLong Nguyen
    Moderator

    Hi Jordan,

    I do not see any issue with your code, screen record https://share.getcloudapp.com/2NuweR4z.

    Please make sure that Meta Box and Meta Box extensions are up to date. Then follow the step Debugging Information here https://support.metabox.io/topic/how-to-create-a-new-topic/.

    Let me know if it helped.

    #28008
    JordanJordan
    Participant

    Everything is up to date. If I deactivate Oxygen completely is does work, so there must be a conflict somewhere.

    #28009
    JordanJordan
    Participant

    I'll contact Oxygen team to see if they can provide help. In the meantime, would there be a way to make it work (for example, keeping post_fields="title, content" in the shortcode but disabling it via CSS display: none)? -- I've tried this but couldn't get it working.

    #28133
    JordanJordan
    Participant

    The issue has been resolved by Oxygen team. The problem was caused by Oxygen's built-in optimisation "Disable WP Emojis", which needs to be unchecked in Oxygen --> settings --> Bloat Eliminator. Conditional Logic now works fine!

    #28143
    Long NguyenLong Nguyen
    Moderator

    Thanks for letting me know. I will mark this topic as Resolved.

Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.