$('input[name="test"]').bind('keydown', function(e) {
var keyCode = (e.which) ? e.which : event.keyCode
return !(keyCode > 31 && (keyCode < 48 || keyCode > 57));
});
This code validates that the data entry contains only numbers, but I need you to accept numbers and the character -
Thanks for your collaboration