How to check if all inputs are not empty with jQuery -


i need validate form jquery. can check inputs 1 one, it's not practical solution.

how can check if inputs non-empty more efficiently? in form can have input elements of different types: text, several groups of radio, select etc.

just use:

$("input:empty").length == 0; 

if it's zero, none empty.

to bit smarter though , filter out items spaces in, do:

$("input").filter(function () {     return $.trim($(this).val()).length == 0 }).length == 0; 

Popular posts from this blog

Php - Delimiter must not be alphanumeric or backslash -

c# - How to change the "Applies To" field under folder auditing options programatically (.NET) -

c++ - Ambiguity when using boost::assign::list_of to construct a std::vector -