Conditional Logic Not Working on Frontend
Support › MB Conditional Logic › Conditional Logic Not Working on FrontendResolved
- This topic has 13 replies, 3 voices, and was last updated 4 years ago by
Long Nguyen.
-
AuthorPosts
-
April 21, 2021 at 11:17 AM #27446
Qu1nt
ParticipantThe conditional logic of my form is not working in the frontend. Works fine in the post type page but shows all fields on frontend
April 21, 2021 at 5:37 PM #27457Long Nguyen
ModeratorHi,
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.
April 22, 2021 at 4:15 AM #27478Qu1nt
ParticipantI am using Twenty TwentyOne Theme and only have oxygen enabled with Metabox, Is oxygen causing the issue?
April 22, 2021 at 4:37 AM #27479Qu1nt
ParticipantGetting this error - uncaught referenceerror wp is not defined
April 22, 2021 at 6:33 AM #27482Qu1nt
ParticipantSo 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.
April 22, 2021 at 10:20 PM #27525Long Nguyen
ModeratorHi,
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.
May 7, 2021 at 9:54 AM #27980Jordan
ParticipantHi 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/TfabQPQuAnd the full code for the custom fields:
https://pastebin.com/eAGrSQBhThanks!
May 7, 2021 at 12:24 PM #27981Long Nguyen
ModeratorHi Jordan,
Please try to use the shortcode in the Block editor or Classic editor. Let me know how it goes.
May 7, 2021 at 7:45 PM #27996Jordan
ParticipantSame problem persists without Oxygen.
May 7, 2021 at 9:35 PM #28004Long Nguyen
ModeratorHi 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.
May 7, 2021 at 10:00 PM #28008Jordan
ParticipantEverything is up to date. If I deactivate Oxygen completely is does work, so there must be a conflict somewhere.
May 7, 2021 at 10:06 PM #28009Jordan
ParticipantI'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.
May 12, 2021 at 11:00 PM #28133Jordan
ParticipantThe 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!
May 13, 2021 at 11:26 AM #28143Long Nguyen
ModeratorThanks for letting me know. I will mark this topic as Resolved.
-
AuthorPosts
- You must be logged in to reply to this topic.