LyndonOHRC
Programmer
I'm trying to have a select default to " " and validate that either of the other options are selected. But I can’t get it to trigger.
Any help appreciated.
Lyndon
Lyndon
---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
Any help appreciated.
Lyndon
Code:
<form action="inserttrack.cfm" name="ReceiptForm" onsubmit="return (LicYear())">
License Year:
<select name="LicenseYear">
<option value="" selected> </option>
<option value="2006">2006</option>
<option value="2007">2007</option>
</select>
<input type="submit" value="Print Preview">
</form>
<script language="JavaScript" type="text/javascript">
function LicYear(){
if (document.ReceiptForm.LicenseYear.value.trim() == ""){
alert('You Must Choose a License Year');
document.ReceiptForm.LicenseYear.focus();
return false
}
}
</script>
Lyndon
---People Remember about 10% of what you say ---They never forget how you made them feel. Covey