I have the following function in my application...
function validateNum(val, numb)
{
if (ValidNumber(val, true) == true)
{
var txt = val.value;
if (txt.length == numb) return true
else {alert('must be '+numb+ ' digits');return false;}
}
return false;
Then I have in my application :
<input name="TxtVendorNo" value="<%=strVndNo%>" size="9" maxlength="9" onBlur="return validateNum(this,6);"></td>
This was working perfectly. Now user says that he should be allowed to enter 6 digits or 9 digits. My validation is for 6 digits. How can I validate now for 6 or 9 digits.
Any help will be appreciated.
Thanks
function validateNum(val, numb)
{
if (ValidNumber(val, true) == true)
{
var txt = val.value;
if (txt.length == numb) return true
else {alert('must be '+numb+ ' digits');return false;}
}
return false;
Then I have in my application :
<input name="TxtVendorNo" value="<%=strVndNo%>" size="9" maxlength="9" onBlur="return validateNum(this,6);"></td>
This was working perfectly. Now user says that he should be allowed to enter 6 digits or 9 digits. My validation is for 6 digits. How can I validate now for 6 or 9 digits.
Any help will be appreciated.
Thanks