jquery validation checks not working properly -


$(document).ready(function(){     $(".submit").click(function(){                 if($('.disrtrict')[0].selectedindex<=0){                     $("#error1").html("district field empty");                  }                   if($(".block")[0].selectedindex<=0){                     $("#error2").html("block field empty");                   }                   if($(".village")[0].selectedindex<=0){                     $("#error3").html("village field empty");                     }              }); }); 

above jquery script.i new jquery , try learn jquery. problem use return false.what concept of return true , false , use if($(".block")[0].selectedindex<=0) can use if($(".block").val()==" ") if 1 have standard checks please provide help.thank in advance.

if form submission return true allow form submit form later executing of javascript , return false not submit form after javascript

now regarding jquery validation , yes can use if($(".class").val()=='') empty or non selection


Comments

Popular posts from this blog

php - Dynamic url re-writing using htaccess -

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -