All the three pick list have the same value (For Ex values are : Dog,Cat,Mouse,Hen)
I want to work it as follow
If user selects Cat in field 1, And If he selects Cat again in field 2 it should give an error message while submitting, saying You can select only one value in one field, you cannot repeat the same value in other fields 2 fields.
i.e The data in the fields will be as follow : Field One : Cat Field Two: Hen Field Three: Dog
If above data save the data.
Field One : Cat Field Two: Cat Field Three: Dog
It Should not save data and throw error
Field One : Hen Field Two: Hen Field Three: Hen
It should not save the data and throw error
Can you please help me with code for above logic, will be really helpful tried a lot with java script no success.
Will be really helpful if you can tell the code and where to keep that code will be very helpful
I have only three fields in the form which are all pick list with same the values.
What I want is if a Cat is selected in field Favourite, and again if Cat is selected in field 2nd Favourite while saving the form it should not save the form and give error that you cannot select the same value in more than one question.
Same if the field 2nd Favourite is having value hen and 3rd Favourite also have the value hen, while saving it should not save the form abd give error that you cannot select the same answer in more than one question
Please can you help, I wrote some javascript in the script tag, but have no idea how to invoke the same.
<script type="text/javascript"> function checkPicklistValue()
if(%%tfa_Favourite%% == %%tfa_2ndFavourite%% || %%tfa_Favourite%% == %%tfa_3rdFavourite%%){ Alert('You cannot use the same answer in two fields'); false; }
Alert('You cannot use the same answer in two fields'); false; } true; </script>
If this is not the way the fields are defined to compare, how do we do it, or any other way we can write this script and use in the form the get output required and told by me Can you please help me with this many thanks