I think I am failing on my regular expression, the best I can tell.
$(document).ready(function() {
$('input').bind('paste', function() {
setTimeout(function() {
var obj = ('input').val();
var text = obj.replace('^[a-zA-Z0-9\\-\\s]+$', ' ');
$('input').val(text);
});
});
});
I have made a fiddle here:
Top comments (0)