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

  • Profile Image
    mreade
    Asked 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

  • Profile Image
    liyam
    Answered 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
    Chriistian
    Answered 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.