How can I compare two selected items from two different select form fields? Hi all...
<SCRIPT LANGUAGE="JavaScript"><!--
function test(what) {
if (what.select1.options[what.select1.selectedIndex].value == what.select2.options[what.select2.selectedIndex].value)
alert('They are the same');
}
--></SCRIPT>
<FORM NAME="myForm">
<SELECT NAME="select1">
<OPTION VALUE="abc">123
<OPTION VALUE="def">456
<OPTION VALUE="ghi">789
</SELECT>
<SELECT NAME="select2">
<OPTION VALUE="abc">123
<OPTION VALUE="def">456
<OPTION VALUE="ghi">789
</SELECT>
<INPUT TYPE="BUTTON" VALUE="SUBMIT" onClick="test(this.form)">
</FORM>
Thanks.... |