kapturedsoul
10-22-2003, 09:13 AM
Good morning everybody! :)
I am trying to make sure that users do not enter certain characters into a form field. I have found it will not find certain characters. For instance:
I have code like this for all of the characters I am looking for:
else if (document.contract.keywords.value.match("@") !=null)
{ window.alert ("@ is not a valid keyword.");
document.contract.keywords.focus();
return false;
and this works fine for most characters, but if I have:
else if (document.contract.keywords.value.match("(") !=null)
{ window.alert ("( is not a valid keyword.");
document.contract.keywords.focus();
return false;
Then it doesn't even find it....that goes for ) as well as 1 or 2 others.
Can anyone please help?
I am trying to make sure that users do not enter certain characters into a form field. I have found it will not find certain characters. For instance:
I have code like this for all of the characters I am looking for:
else if (document.contract.keywords.value.match("@") !=null)
{ window.alert ("@ is not a valid keyword.");
document.contract.keywords.focus();
return false;
and this works fine for most characters, but if I have:
else if (document.contract.keywords.value.match("(") !=null)
{ window.alert ("( is not a valid keyword.");
document.contract.keywords.focus();
return false;
Then it doesn't even find it....that goes for ) as well as 1 or 2 others.
Can anyone please help?