Hi,
I’ve got a form which I want to validate using jQuery to ensure that the same value for a dropdown has not been entered more than once.
The form consists of the following:
<li class="clonedInput" id="input1">
Name:
<select id="player[1][userid]" name="player[1][userid]"></select>
<select class="hours" id="player[1][hours]" name="player[1][hours]"></select>
<select class="mins" id="player[1][mins]" name="player[1][mins]"></select>
</li>
<li class="clonedInput" id="input2">
Name:
<select id="player[2][userid]" name="player[2][userid]"></select>
<select class="hours" id="player[2][hours]" name="player[2][hours]"></select>
<select class="mins" id="player[2][mins]" name="player[2][mins]"></select>
<li>
<li class="clonedInput" id="input3">
Name:
<select id="player[3][userid]" name="player[3][userid]"></select>
<select class="hours" id="player[3][hours]" name="player[3][hours]"></select>
<select class="mins" id="player[3][mins]" name="player[3][mins]"></select>
<li>
As you can see, each player has a userid, hours and mins dropdown
I want to make sure that the userid is not duplicated on submit.
I’m not sure how I find each userid per player and then hold it to compare to other userids submitted
I do not have to use jQuery but from my investigations so far it would seem to offer the best solution but I’m open to all ideas!
Any guidance on this is greatly appreciated.
thanks
aor