145
rated 0 times
[
152]
[
7]
/ answers: 1 / hits: 149473
/ 12 Years ago, mon, october 8, 2012, 12:00:00
I made a regular expression that only accepts letters. I'm not really good in regex, thats why I don't know how to include spaces in my regex.
My HTML:
<input id=input />
My js / jQuery code:
$('#input').on('keyup', function() {
var RegExpression = /^[a-zA-Z]*$/;
if (RegExpression.test($('#input').val())) {
}
else {
$('#input').val();
}
});
More From » jquery