On submit I do this:
$('#add-form').submit(function(e){ e.preventDefault(); if($('input[name=published]').is(':checked')) p.validateImgs(); //stop if p.validateImgs returns false Validate Imgs Function:
p.validateImgs = function() { //Check Thumb var thumb = $('#thumb li .img-drop-zone'); if(!thumb.has('img').length)thumb.addClass('error'); //Check Galery var gallery = $('#gallery li .img-drop-zone').first(); if(!gallery.has('img').length)gallery.addClass('error'); //return true/false }; How can I make it if false is returned from validateImgs, the submit script stops?