Ekspresi reguler untuk tidak memberikan ruang dalam JavaScript
var regexp = /^\S*$/; // a string consisting only of non-whitespaces
Indian Gooner
var regexp = /^\S*$/; // a string consisting only of non-whitespaces
var regex = new RegExp("^[A-Za-z0-9? ,_-]+$");
var key = String.fromCharCode(event.charCode ? event.which : event.charCode);
if (!regex.test(key)) {
event.preventDefault();
return false;
}
"^[A-Za-z0-9? ,_-]+$"