/    Sign up×
Community /Pin to ProfileBookmark

Validation and Selectboxes!!!

Hi,

I am trying to validate the following form so that a selectbox option can only be selected once on the form (i.e. no 2 selectboxes can have the same option select). But I have absoloutly no idea how to go about it, Help with this will be much appreciated.

<form name=”InsertFixtures” method=”post” action=”” onSubmit=”return ValidateSelect(this)”>

<table width=”96%” border=”1″ height=”189″>
<tr>
<td colspan=”2″ height=”54″>
<div align=”center”><b>Insert Fixture</b></div>
</td>
</tr>
<tr>
<td height=”23″ width=”49%”>
<div align=”center”>Home Team</div>
</td>
<td width=”51%” height=”23″>
<div align=”center”>Away Team</div>
</td>
</tr>
<tr>
<td height=”24″>
<div align=”center”>
<select name=”select”>
<option> </option>
<option value=”Bulli”>Bulli</option>
<option value=”Warilla Wanderers”>Warilla Wanderers</option>
<option value=”Woonona”>Woonona</option>
<option value=”University”>University</option>
<option value=”Shoalhaven”>Shoalhaven</option>
<option value=”South Coast Utd”>South Coast Utd</option>
<option value=”Fernhill”>Fernhill</option>
<option value=”Highlands”>Highlands</option>
<option value=”Helensburgh”>Helensburgh</option>
<option value=”Bellambi”>Bellambi</option>
<option value=”Ruse”>Ruse</option>
<option value=”Corrimal Rangers”>Corrimal Rangers</option>
<option value=”Shell Workers”>Shell Workers</option>
<option value=”Berkeley”>Berkeley</option>
<option value=”Shellharbour City”>Shellharbour City</option>
<option value=”Bye”>Bye</option>
</select>
</div>
</td>
<td height=”24″>
<div align=”center”>
<select name=”select2″>
<option> </option>
<option value=”Bulli”>Bulli</option>
<option value=”Warilla Wanderers”>Warilla Wanderers</option>
<option value=”Woonona”>Woonona</option>
<option value=”University”>University</option>
<option value=”Shoalhaven”>Shoalhaven</option>
<option value=”South Coast Utd”>South Coast Utd</option>
<option value=”Fernhill”>Fernhill</option>
<option value=”Highlands”>Highlands</option>
<option value=”Helensburgh”>Helensburgh</option>
<option value=”Bellambi”>Bellambi</option>
<option value=”Ruse”>Ruse</option>
<option value=”Corrimal Rangers”>Corrimal Rangers</option>
<option value=”Shell Workers”>Shell Workers</option>
<option value=”Berkeley”>Berkeley</option>
<option value=”Shellharbour City”>Shellharbour City</option>
<option value=”Bye”>Bye</option>
</select>
</div>
</td>
</tr>
<tr>
<td height=”24″>
<div align=”center”>
<select name=”select3″>
<option> </option>
<option value=”Bulli”>Bulli</option>
<option value=”Warilla Wanderers”>Warilla Wanderers</option>
<option value=”Woonona”>Woonona</option>
<option value=”University”>University</option>
<option value=”Shoalhaven”>Shoalhaven</option>
<option value=”South Coast Utd”>South Coast Utd</option>
<option value=”Fernhill”>Fernhill</option>
<option value=”Highlands”>Highlands</option>
<option value=”Helensburgh”>Helensburgh</option>
<option value=”Bellambi”>Bellambi</option>
<option value=”Ruse”>Ruse</option>
<option value=”Corrimal Rangers”>Corrimal Rangers</option>
<option value=”Shell Workers”>Shell Workers</option>
<option value=”Berkeley”>Berkeley</option>
<option value=”Shellharbour City”>Shellharbour City</option>
<option value=”Bye”>Bye</option>
</select>
</div>
</td>
<td height=”24″>
<div align=”center”>
<select name=”select4″>
<option> </option>
<option value=”Bulli”>Bulli</option>
<option value=”Warilla Wanderers”>Warilla Wanderers</option>
<option value=”Woonona”>Woonona</option>
<option value=”University”>University</option>
<option value=”Shoalhaven”>Shoalhaven</option>
<option value=”South Coast Utd”>South Coast Utd</option>
<option value=”Fernhill”>Fernhill</option>
<option value=”Highlands”>Highlands</option>
<option value=”Helensburgh”>Helensburgh</option>
<option value=”Bellambi”>Bellambi</option>
<option value=”Ruse”>Ruse</option>
<option value=”Corrimal Rangers”>Corrimal Rangers</option>
<option value=”Shell Workers”>Shell Workers</option>
<option value=”Berkeley”>Berkeley</option>
<option value=”Shellharbour City”>Shellharbour City</option>
<option value=”Bye”>Bye</option>
</select>
</div>
</td>
</tr>
<tr>
<td height=”24″ colspan=”2″>
<div align=”center”> </div>
<div align=”center”></div>
<div align=”center”>
<input type=”submit” name=”Submit” value=”Submit”>
</div>
</td>
</tr>
</table>
</form>

cheers,

Warkem

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@Khalid_AliOct 23.2003 — you have two sets of select boxes,did you mean you wanted unique selection between the 2 slect boxes for each group or all four must have unique value?
Copy linkTweet thisAlerts:
@warkemauthorOct 23.2003 — Sorry I wasn't clear, yes all four boxes to be unique, cheers
×

Success!

Help @warkem spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.4,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...