Hi all,
I'm pulling my hair trying to understand why this js validation is not called when submitted.
I'm pulling my hair trying to understand why this js validation is not called when submitted.
Code:
<script language="javascript">
<!--
function getValidate(theForm) {
if (theForm.no_of_label.selectedIndex==0)
{
alert( "Choose Number of Label per month!" );
return false;
}
if (theForm.length_per_role.selectedIndex==0)
{
alert( "Choose Length per Role!" );
return false;
}
if (theForm.cost_per_role.value=="")
{
alert("Empty Value of Cost/Role!");
theForm.cost_per_role.focus();
return false;
}
return true;
}
-->
</script>
</head>
<body>
<table width="40%" bgcolor="#CCFF99" align="center" cellpadding="2" style="padding:5px">
<tr>
<form name="getsave" id="getsave" method="post" onsubmit="return getValidate(this);">
<td align="right" nowrap="nowrap"># of label: </td>
<td align="left"><select name="no_of_label">
<option value=""><- Select -></option>
<option value="300">300</option>
<option value="400">400</option>
<option value="500">500</option>
<option value="600">600</option>
<option value="700">700</option>
<option value="800">800</option>
<option value="900">900</option>
<option value="1000">1000</option>
<option value="2000">2000</option>
<option value="300">3000</option>
</select></td>
</tr><tr>
<td align="right" nowrap="nowrap">$/role: </td>
<td align="left"><input type="text" name="cost_per_role" maxlength="7" size="7" /></td>
</tr><tr>
<td align="right" nowrap="nowrap">Role length: </td>
<td align="left"><select name="length_per_role">
<option value=""><- Select -></option>
<option value="50">50</option>
<option value="100">100</option>
<option value="150">150</option>
</select></td>
</tr><tr>
<input type="hidden" name="form00" value="getSave" />
<td colspan="2" align="center"><input type="reset" value="Clear" /><input type="submit" name="submit" value="Get Result" /></td>
</form>
</tr>
</table>