$(document).ready(function(){
$(".submit").click(function(){
if($('.disrtrict')[0].selectedIndex<=0){
$("#error1").html("district field is empty");
}
if($(".block")[0].selectedIndex<=0){
$("#error2").html("block field is empty");
}
if($(".village")[0].selectedIndex<=0){
$("#error3").html("village field is empty");
}
});
});
上記は私のjqueryスクリプトです。私はjqueryが初めてで、jqueryを学ぼうとしています。私の問題は、return false を使用する場所です。return true と false の概念を使用します。標準チェックがある場合if($(".block")[0].selectedIndex<=0)
は使用できます。事前にヘルプを提供してください。if($(".block").val()==" ")