-
validation help
I have a text box in a form that is validated to accept a value called ds01 but i also want the textbox to be allowed to accept empty spaces that is if nothing is entered in the textbox. The problem is that it does not accept anything other than ds01. Thanx in advance for your help. This is my script
function validate_choice(field,alerttxt)
{
with (field)
{
if (value != "ds01")
{
alert(alerttxt);return false;
}
else if (value ==null || value == "" || value=="ds01")
{
return true;
}
}
}
function validate_form(thisform)
{
with (thisform)
{
if (validate_choice(webdev, "You Must Enter the Correct Code.Please Enter ds01!.Thank You!")==false)
{webdev.focus();return false;}
}
}
-
Re: validation help
I will suggest you instead of providing ds01 as Input, try accepting your input value and in conditional statement keep if (value ==null || value == "" || value=="ds01"), henceforth it will ask for user input and if it is ds01 then fullfills the condition statement will be executed.
Page generated in 1,714,005,508.62718 seconds with 10 queries