Posted By

erraja_07 on 06/03/11


Tagged

js validation


Versions (?)

Javascript Special Characters validation


 / Published in: JavaScript
 

  1. function isSpclChar(comments)
  2. {
  3. var iChars = "!@#$%^&*()+=-[]\\\';,./{}|\":<>?";
  4. var cnt=0;
  5. for (var i = 0; i < comments.length; i++)
  6. {
  7. if (iChars.indexOf(comments.charAt(i)) != -1)
  8. {
  9. cnt=cnt+1;
  10. }
  11. }
  12. if(cnt==comments.length)
  13. return false;
  14. else
  15. return true;
  16. }

Report this snippet  

You need to login to post a comment.