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
Post a Comment