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;}
}
}
Bookmarks