What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

    Creating an error message when someone submits two values that are the same

    Asked by mreade on February 03, 2017 at 06:41 PM

    https://form.jotformeu.com/70316679059363

    Hello

    I need to enforce some eligability criterial for a small grants scheme.  Applicants must be based in different faculties.

    Therefore if the faculty selected in the drop down list in Faculty #_input91 is the same as #_input239 can Jotform produce a message reminding applicants that they must be based in different faculties?

    Thanks for your help.

    Michael  Reade

    Page URL:
    https://form.jotformeu.com/70316679059363

  • Profile Image
    JotForm Support

    Answered by liyam on February 04, 2017 at 01:08 AM

    Hello Michael,

    Unfortunately, there is currently no direct method for getting two fields for comparison for validation. So you will need to create conditions for comparison for each value which can be selected for two fields. Here's an example of what I mean:

    So you will need to have one item for each as your condition.

    Alternatively, you can get your form's full HTML source and place it on your own web page. Then you can insert javascript codes in it for validation. You can check this guide for more information: https://www.jotform.com/help/104-How-to-get-the-Full-Source-Code-of-your-Form

    If you have questions, please let us know.

    Thanks.

     

  • Profile Image
    JotForm Support

    Answered by Chriistian on February 04, 2017 at 01:18 AM

    Another workaround you can try to implement the validation is to pass the value of the drop down field in Form Calculation and use the conditions to show/hide error message. Here is a sample cloned form that I used for testing: https://form.jotform.com/70340441809956.

     

    Here is a step by step guide to implement the checking.

    1. Add Text field in your form for the Error Message.

    2. Add two form calculation field that will capture the selected value for each Faculty field.

    Faculty 1 calculation Value:

    Faculty 2 calculation Value:

    3. Setup Condition to show error message and also hide the submit button so user will not be able to submit the form.

     

    You can also clone the sample form (https://form.jotform.com/70340441809956) that I have created so you can have a closer look on the setup. To clone a form, just follow the instruction provided in this article: How to Clone an Existing Form from a URL.