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.
Validation for no duplicates in two different DropdownAsked by thyrocare on August 01, 2014 at 12:30 AM
I want to give an Validation for no duplicates in two different Dropdown option related form (survey)
There are 2 dropdowns and Each Containing same options such as
and If i select father / Mother it should not repeat in another field / dropdown options, (it should Hide automatically)
But i dont want to add more fields.
Can You do it for me? for the form.
Or is there any Other option to Validate on submit?
This is only possible using form source. We'll try to make a sample and let you know via this thread once done.
Sorry for the late response. You can view the sample form in this link. Like what you've requested the validation will not duplicate selected option for 2 dropdowns like what you mention above.
Let us know the form from which the script will be applied so we can help you.
Let me know how can i do it ? and also want to do it only for first three Options such as no same for Spouse, father and Mother.
but i can select as many brother, sister, son and daughter.
I have updated the code that only disable's Spouse,Father and Mother and the rest can be selected twice.
It would be best if you have a finished form already but if you want to know how to apply this code by yourself then you can follow the instruction below.
1. Here is the script that will be used http://pastie.org/9438884.
2. Once you download your forms source edit it using notepad or some other editors, I use notepad++.
3. Since the code is written in jquery language you need to add this line of code <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> somewhere inside the <head> </head> tag. I suggest to place it beside the other <script> </script> tags as well.
4. Paste the code that I provided above below before the </body> ends.
5. Now there are 2 values that you need to replace to make this. Since we are using 2 dropdown fields we need to get the ID's of those dropdowns.
6. Once you have identified the ID's of each drop downs then let's replace the value in the script that I've provided earlier.
Let us know if you need help.
Is there any short cut thing to do it in Form....
I'm afraid that you can't do it in the form. It needs to be added to the form source codes. We can help you to implement the whole codes to your form. But we advise finishing your form first so everything will be final - to avoid going back and making additional changes.
An alternative would be using our Dynamic Dropdown Widget: http://widgets.jotform.com/widget/dynamic_dropdowns. Example Form: http://www.jotformpro.com/form/42134587102953