How to validate a field based on another field?

  • CMHForms
    Asked on July 5, 2017 at 4:13 AM
    Also, for https://form.jotform.us/71795738084167, how do I validate a field value (example if the Grade is 12, the session has to be 1)
  • Support_Management Jotform Support
    Replied on July 5, 2017 at 4:52 AM

    From how you described it, you want to ensure that if users select Grade 12, they should only select Session 1, correct?

    If so, what you can do is add a Text Field that will show them a warning/error that they need to pick Session 1 if they selected Grade 12. Here's how this would be setup:

    1. Add a Text Field to your form that will show your warning/error message.

    e.g. You should select Session 1 if you select Grade 12

    2. Add a Condition similar to the one below:

    How to validate a field based on another field? Image 1 Screenshot 30

    Related guide: How-to-Show-or-Hide-Fields-Base-on-User-s-Answer 

    Logic:

    IF Grade IS EQUAL to Grade 12 AND Session IS NOT EQUAL TO Session 1

    THEN SHOW the Text Field error AND HIDE the Submit button

    Result:

    How to validate a field based on another field? Image 2 Screenshot 41