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

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

How to get multiresult with multicondition in Sql Server -