Hi,
I tried to validate a text field to see whether the string contains a comma or not. If there is no comma in that string, alert box appears. Now the problem is that I cannot unescape comma. My code is as follows:
function upd_info(f){
var err = true;
for (var i=0; i < f.elementname.value.toString().length; i++){
var oneChar = f.elementname.value.toString().charAt(i);
if (oneChar == ","
{ //also tried if (oneChar == unescape("%2C"
)
err = false; break; }
}
if (err == true){
alert("You must have a comma to separate the last name and the first name."
;
return(false);
}
return(true);
}
Thanks in advance...
-J
I tried to validate a text field to see whether the string contains a comma or not. If there is no comma in that string, alert box appears. Now the problem is that I cannot unescape comma. My code is as follows:
function upd_info(f){
var err = true;
for (var i=0; i < f.elementname.value.toString().length; i++){
var oneChar = f.elementname.value.toString().charAt(i);
if (oneChar == ","
err = false; break; }
}
if (err == true){
alert("You must have a comma to separate the last name and the first name."
return(false);
}
return(true);
}
Thanks in advance...
-J