if(!$.trim($('.xlarge').value).length) {
return false;
}
And the HTML is:
<input class="xlarge" name="name">
I checked on my console if the syntax is right, it is right, but even if the value is not empty it still doesn’t submit the form. What’s wrong?
No need to check length just use :
val() returns the value of the input – docs for val()
Discussed here Check if inputs are empty using jQuery