Prevent Space in the input field

Html input tag

<input type='text' name="users" />

Simply add this line of code into your HTML pages scripts

$('input').keypress(function( e ) {
    if(e.which === 32) 
        return false;
});
0 0 vote
Article Rating

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x