Title: Conditional Logic issue with validation
Last modified: August 22, 2016

---

# Conditional Logic issue with validation

 *  Resolved [melissadoyon](https://wordpress.org/support/users/melissadoyon/)
 * (@melissadoyon)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/conditional-logic-issue-with-validation/)
 * Hello!
 * I need help with my registration form. I have 2 context issues with conditional
   logic and validation.
 * First, I have a radio button to know if my member wants to receive our newsletter.
   Options are Yes/No. If member ckecks Yes than I show a list of checkboxes so 
   they can add their preferences. Ckeckboxes are By email/By mail. They have to
   check at leat 1 checkbox. The problem is that when they select No at first, the
   form won’t submit because of the mandatory checkboxes that are hidden. The form
   should ignore hidden fields when validating the form.
 * Also I noticed that when I submit the form and there are errors triggered, neither
   my radio buttons no my checkboxes are ckecked anymore…
 * Second, I have a radio button asking if they want to provide their clinic information.
   Again Yes/No. If answer is Yes I show a bunch of other text fields that are required.
   If I check No the form will still validate the hidden fields.
 * How can I fix this? Is this a bug or am a not setting my form correctly?
 * Thanks for your help.
    MD
 * [https://wordpress.org/plugins/ultimate-member/](https://wordpress.org/plugins/ultimate-member/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Ultimate Member](https://wordpress.org/support/users/ultimatemember/)
 * (@ultimatemember)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/conditional-logic-issue-with-validation/#post-5901119)
 * Hi there!
 * At this time, we can’t have “required” fields inside a “conditional logic” as
   both are opposite to each other. e.g. The field can be optional in theory if 
   the user didn’t specify a rule that makes it show based on condition. So making
   it require will stop the form from loading.
 * Is it the same issue you’re facing or different one? It’s a current limitation
   in the conditional logic I am afraid.
 * Thanks!
 *  Thread Starter [melissadoyon](https://wordpress.org/support/users/melissadoyon/)
 * (@melissadoyon)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/conditional-logic-issue-with-validation/#post-5901127)
 * Hi!
 * Ok I will try to work around that the conditional logic. Same problem but 2 differents
   contexts.
 * What about the radio buttons and checkboxes that were checked before the submit
   but are empty after submitting form with errors. Is there a solution for that?
 * Thanks
    MD
 *  Plugin Author [Ultimate Member](https://wordpress.org/support/users/ultimatemember/)
 * (@ultimatemember)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/conditional-logic-issue-with-validation/#post-5901158)
 * Please sign up to our forum and post about this issue. We have not receive a 
   bug report about that issue through our forums before:
 * [https://ultimatemember.com/forums/](https://ultimatemember.com/forums/)

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Conditional Logic issue with validation’ is closed to new replies.

 * ![](https://ps.w.org/ultimate-member/assets/icon-256x256.png?rev=3160947)
 * [Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin](https://wordpress.org/plugins/ultimate-member/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ultimate-member/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ultimate-member/)
 * [Active Topics](https://wordpress.org/support/plugin/ultimate-member/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ultimate-member/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ultimate-member/reviews/)

## Tags

 * [conditional logic](https://wordpress.org/support/topic-tag/conditional-logic/)
 * [validation](https://wordpress.org/support/topic-tag/validation/)

 * 3 replies
 * 2 participants
 * Last reply from: [Ultimate Member](https://wordpress.org/support/users/ultimatemember/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/conditional-logic-issue-with-validation/#post-5901158)
 * Status: resolved