Restrict space at first position in textbox using jquery/javascript


wonderphp

$("input").on("keypress", function(e) {
    if (e.which === 32 && !this.value.length)
        e.preventDefault();
});

View original post