今天遇到为combobox动态添加必填属性验证,简要说明一下:
我原来的代码是:
改变它为必填属性操作如下:
$("#footageIds").combobox.attr({required:true});
结果没有成功。
在网上百度一遍后,有人提到是属性添加顺序的问题,于是小可对js部分又做了如下修改:
<input class="easyui-combobox "
id="noticeIds"
name="noticeIds"
valueField="id"
textField="text"
multiple="true"
panelHeight="auto"
editable="false"
style="width:313px"
[color=#FF0000]required=false[/color]
>
然后在通过如下操作,成功OK:
我原来的代码是:
<input class="easyui-combobox "
id="noticeIds"
name="noticeIds"
valueField="id"
textField="text"
multiple="true"
panelHeight="auto"
editable="false"
style="width:313px"
>
改变它为必填属性操作如下:
$("#footageIds").combobox.attr({required:true});
结果没有成功。
在网上百度一遍后,有人提到是属性添加顺序的问题,于是小可对js部分又做了如下修改:
<input class="easyui-combobox "
id="noticeIds"
name="noticeIds"
valueField="id"
textField="text"
multiple="true"
panelHeight="auto"
editable="false"
style="width:313px"
[color=#FF0000]required=false[/color]
>
然后在通过如下操作,成功OK:
$("#footageIds").combobox.attr({required:true});
此稿是个人经验,仅供参考,如有差错,望不吝赐教!