I'm using jquery validator alpha numeric rule but i want to allow space but right now the issue is when i give space it shows error, my main requirement is i don't want user to enter special characters ore symbols in text fields, my code is like this:
<form id="myform">
<input type="text" name="field" />
<br/>
<input type="submit" />
</form>
Script:
$(document).ready(function () {
$('#myform').validate({ // initialize the plugin
rules: {
field: {
required: true,
alphanumeric: true
}
},
submitHandler: function (form) { // for demo
alert('valid form submitted'); // for demo
return false; // for demo
}
});
});