Kylena
08-26-2004, 02:42 AM
I've the following code:
function validateText(fld, errMsg)
{
if(fld.value=="" || fld.value == " ")
{
alert("Please enter a value for " + errMsg + ".");
fld.focus();
return false;
}//endif
return true;
}//endfunction validatetext
However, it works only if there is a space, not when multiple spaces occur consecutively.
How do I make this validate if the user purposely enter spaces/blanks? :confused:
function validateText(fld, errMsg)
{
if(fld.value=="" || fld.value == " ")
{
alert("Please enter a value for " + errMsg + ".");
fld.focus();
return false;
}//endif
return true;
}//endfunction validatetext
However, it works only if there is a space, not when multiple spaces occur consecutively.
How do I make this validate if the user purposely enter spaces/blanks? :confused: