jQuery

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;
});

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button