Allowed only Alphanumeric character

<script src=”js/jquery.js” type=”text/javascript”></script>
<script src=”js/jquery.validate.min.js” type=”text/javascript”></script>
<script type=”text/javascript”>
$(“#mobilejj”).bind(‘keyup’, function(){
var TCode = document.test_form.mobilejj.value;
for(var i=0; i<TCode.length; i++)
var char1 = TCode.charAt(i);
var cc = char1.charCodeAt(0);
if((cc>47 && cc<58) || (cc>64 && cc<91) || (cc>96 && cc<123))
alert(‘Special character are not allowed\n\nPlease enter only alphanumeric’);
return false;

<form name=”test_form” id=”test_form” action=”” enctype=”multipart/form-data”>
<input type=”text” name=”mobilejj” id=”mobilejj” value=”” >
<input type=”text” name=”phonejj” id=”phonejj” value=””>
<input type=”submit” name=”test_send” id=”test_send” value=”Submit”>


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s