我在 div 中循环输入字段,我想检查所有输入是否已填充,如果已填充则希望自动保存。我尝试使用以下代码
<?php for ($i=0; $i <3; $i++) { ?>
<div class="quick_row" id="row_<?php echo $i++; ?>" >
<div class="span3"><input id="form_no" name="form_no" value="" class="inputbox required form_no" type="text"><span class="msg"></span></div>
<div class="span3"><input id="name" name="name" value="" class="inputbox required" type="text"><span class="msg"></span></div>
<div class="span3"><input id="nic" name="nic" value="" class="inputbox required nic" maxlength="12" minlength="12" type="text"><span class="msg"></span></div>
<div class="span3"><input id="mobile" name="mobile_no" value="" class="inputbox required mobile" maxlength="10" type="text"><span class="msg"></span></div>
<div class="clear"></div>
</div>
<?php } ?>
js(this).find(".quick_row input").on("focusout change", function(){
//js("#empower_quick input").on("focusout change", function(){
var inputValidate = true;
js(this).find(".quick_row input").each(function(index, element){
if (js(element).val() == "")
inputValidate = false;
});
if (inputValidate){
// alert("sdfsfdsf");
// js("#form2").show();
}
// alert("pramod");
});