tiamat2012
Programmer
Basically I'm doing a form validation, and allowing certain characters (that my client requested). Because he wants "s, -s and such, I've tried to use HTML entities, but its only working on the ampersand.
I've never learned the structure of how to write these and just picked it up and tried to edit them, and I don't know the name of what type of formatting it is so I don't know where to learn. Can anyone help me?
Sincerely,
Kerry
I've never learned the structure of how to write these and just picked it up and tried to edit them, and I don't know the name of what type of formatting it is so I don't know where to learn. Can anyone help me?
Code:
[blue]
var charpos = objValue.value.search("[^A-Za-z0-9\ &"-$.,'!#?()]");[/blue]
if(objValue.value.length > 0 && charpos >= 0)
{
if(!strError || strError.length ==0)
{
strError = objValue.name+": Only alpha-numeric characters allowed ";
}//if
alert(strError + "\n [Error character position " + eval(charpos+1)+"]");
return false;
}//if
break;
Sincerely,
Kerry