Trim and check if input is empty
3 answers
No need to check the length, just use:
if(!$.trim($('.xlarge').val())) { return false; } val () returns the input value - docs for val ()
Discussed here. Check for empty entries using jQuery.
+5
Instead:
$('.xlarge').value You should use:
$('.xlarge').val() .val() is a jQuery function that will return the value first element in the set of matched elements. Here's a link to the documentation: http://api.jquery.com/val/ .
+2