Hello,
I have IE7.
I have code in javascript in my
jsp as
function check()
{
var iChars = "!@#$%^&*()+=-[]\\\';,./{}|\":<>?";
for (var i = 0; i < document.frm.name.value.length; i++) {
if (iChars.indexOf(document.frm.fieldname.value.charAt(i)) != -1) {
alert ("Your username has special characters. \nThese are not allowed.\n Please remove them and try again.");
return false;
}
}
return true;
}
and my jsp code
<s:form name="frm" action="customer.action" method="post" validate="true" onsubmit="javascript:return check();">
<s:textfield name="name" key="name" size="20" maxlength="20"/>
I want user not enter any special charactes in the name field.
so its giving me in javascript function as charAt(number) is undefined.
simliarly frm is undefined whicj is the form name I have given,
Please help.