jquery - check whether the empty string exist in an input field -
how check whether input form has empty string? tried use code below didn't work.
e.which == 13 catch whether user press enter key, secondly !== "" prevent data input if there nothing typed.. why didn't work? logic seem ok.. first 1 worked, second didn't..
if(e.which == 13 && $(inputbar) !== ""){ // }
you should checking $(inputbar).val() not $(inputbar) return object not value of text in input box
Comments
Post a Comment