Forum Moderators: open
DON
<form>
<select name="lista" onChange="chkLists(this.form,this.name);">
<option value="a">a</a>
<option value="b">b</a>
</select>
<select name="listb" onChange="chkLists(this.form,this.name);">
<option value="a">a</a>
<option value="b">b</a>
</select>
<input type="hidden" name="whichlist" value="">
</form>
function chkLists(form,which) {
form.whichlist.value=which;
form.submit();
}
OR . . . a server-side solution is even more simple. If you're submitting onChange, simply make the first element of your select lists blank,
<select name="lista" onChange="this.form.submit();">
<option value="">Please Select</a>
<option value="a">a</a>
<option value="b">b</a>
</select>
Then in the programming language of your choice,
$selectedList = ($qs{'a'} ne '')?$qs{'a'}:$qs{'b'};
But if they've somehow managed to submit them both blank, return back to the page to select:
if (! $selectedList) { &html("Same Page with Message"); }