Hi. I have a form that I am using for a google map page and I want to limit the input field to allow only a-z, A-Z, 0-9, spaces and hyphens. I was using:
var postCode = $('#form').val();
Validate = /[a-z0-9 A-Z\-]$/.test(postCode);
if (!Validate) {
$('#results').html("Please enter alpha numeric (a-z 0-9) characters");
return;
}
but that doesn't work. Could someone help me fix it?