Alex Barber | Digital Artist

time to push the pixels

jQuery detect input fields are blank

Used this one to check if all hidden fields in a form were blank, and prevent form submit if they were.

// check if hidden fields are all blank
var allBlank = true;
$('input.searchhidden').each(function() {
return allBlank = allBlank && !$(this).val();

if ( allBlank ) {

Next Post

Previous Post

Leave a Reply

© 2024 Alex Barber | Digital Artist