| Author: Jakkaraju Sivakumar Sandeep kumar 20 Sep 2006 | Member Level: Silver | Rating: Points: 2 |
which special chars u want avoid be clear ...
|
| Author: Mohan Kumar 20 Sep 2006 | Member Level: Diamond | Rating: Points: 2 |
hi,
go through links.
http://aspnet.4guysfromrolla.com/articles/022603-1.aspx www.devarticles.com/c/a/VB.Net/Regular-Expressions-in-.NET
-Mohan kumar
|
| Author: Mohan Kumar 20 Sep 2006 | Member Level: Diamond | Rating: Points: 2 |
hi,
go through links.
http://aspnet.4guysfromrolla.com/articles/022603-1.aspx www.devarticles.com/c/a/VB.Net/Regular-Expressions-in-.NET
-Mohan kumar
|
| Author: Padma 20 Sep 2006 | Member Level: Diamond | Rating: Points: 2 |
Try with Javascript function isAlphaKey(evt) { var charCode = (evt.which) ? evt.which : event.keyCode if (charCode > 31 && (charCode < 65 || charCode > 90) && (charCode < 97 || charCode > 122)) return false;
return true;
}
|
| Author: Padma 20 Sep 2006 | Member Level: Diamond | Rating: Points: 2 |
Try with javascript function isAlphaKey(evt) { var charCode = (evt.which) ? evt.which : event.keyCode if (charCode > 31 && (charCode < 65 || charCode > 90) && (charCode < 97 || charCode > 122)) return false;
return true;
}
|
| Author: Alla.Harini 20 Sep 2006 | Member Level: Silver | Rating: Points: 2 |
<script language="javascript">
function validate() {
var iChars = "!@#$%^&*()+=-[]\\\';,./{}|\":<>?"+" ";//" " used to avoid space
for (var i = 0; i < document.formname.fieldname.value.length; i++) { if (iChars.indexOf(document.formname.fieldname.value.charAt(i)) != -1) { alert ("Your username has special characters. \nThese are not allowed.\n Please remove them and try again."); return false; } else { return true; } }
} </script> U just place what ever characters u want to avoid in "iChars" field
Regards, Harini
|