If you want to set alphanumeric and numaric validation in your jquery validation then first define two variable one fro alphanumeric and second for numeric and set both filter value. For better understanding you need to follow below example code.
Example code is here:
<script>
var pen_filter=/^(?=.*[a-zA-Z])(?=.*[0-9])/;
var numeric_filter=/^(?=.*[0-9])/;
if(!pen_filter.test(pen) && !numeric_filter.test(pen)){
$(‘#PenErr’).text(‘*Enter at least 1 Alpha numeric value.’);
$(‘#pen’).focus();
return false;
}
</script>
Question and answer is powered by AnsPress.io