Hi everybody,

      Can anybody help me how to validate special characters in Javascript.

     It should not accept the characters which i used in array
declaration.In the below it shows some error.

   Anybody can help me immediately!!!

thnx
sar.





My part of code is:
*********************

<script language=javascript>
function myfunc()
{
   var  str=new Array("~","!","#","$","%","^","&","*");
   var ss=document.f1.un.value;


   for(i=0;i<str.length;i++)
   {
          if(ss.substr(i,i+1).equals(str[i]))
      {       alert("special character not allowed");
              return(document.f1.un.value="");
      }
   }
}



<input type="text" name="un" maxlength="10" onblur="myfunc()">





_____________________________________________________________________________________
Get more from the Web.  FREE MSN Explorer download : http://explorer.msn.com

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to