脚本宝典收集整理的这篇文章主要介绍了php – codeigniter表单验证和数组作为字段名称,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
div class="grid_7"> <fieldset class="age shadow_50"> <label class="legend">Age Group</label> <div class="formRow checkBox"> <input id="" tyPE="checkBox" name="age[]" value="child" /> <label>Child</label> </div> <div class="formRow checkBox"> <input id="" type="checkBox" name="age[]" value="30's" /> <label>30s</label> </div> <div class="formRow checkBox"> <input id="" type="checkBox" name="age[]" value="60's" /> <label>60's</label> </div> <div class="formRow checkBox"> <input id="" type="checkBox" name="age[]" value="teen" /> <label>Teen</label> </div> <div class="formRow checkBox"> <input id="" type="checkBox" name="age[]" value="40's" /> <label>40's</label> </div> <div class="formRow checkBox"> <input id="" type="checkBox" name="age[]" value="70's" /> <label>70's</label> </div> <div class="formRow checkBox"> <input id="" type="checkBox" name="age[]" value="20's" /> <label>20's</label> </div> <div class="formRow checkBox"> <input id="" type="checkBox" name="age[]" value="50's" /> <label>50's</label> </div> </fieldset> </div>
我在我的控制器中设置了一个验证规则(在我看来)确保选中了一个复选框,
$this->form_validation->set_rules('age[]','age group','required|trim');
以上是脚本宝典为你收集整理的php – codeigniter表单验证和数组作为字段名称全部内容,希望文章能够帮你解决php – codeigniter表单验证和数组作为字段名称所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。