combobox动态添加必填属性验证
2015-08-14 11:01
357 查看
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/hailang2513/article/details/47658755
今天遇到为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});
此稿是个人经验,仅供参考,如有差错,望不吝赐教!
相关文章推荐
- flex 动态添加验证
- mvc中动态给一个Model类的属性设置验证
- ios开发runtime学习四:动态添加属性
- 20170702-变量说明,静态方法,类方法区别,断点调试,fork,yield协程,进程,动态添加属性等。。
- JQuery EasyUI combobox动态添加option
- EasyUI中,使用jquery或者js动态添加元素,验证失效的解决办法
- 给控件动态添加属性的做法、IExtenderProvider接口的使用
- JQuery EasyUI combobox动态添加option
- JS动态创建表格,动态设置属性,动态添加事件
- javascript动态添加、修改、删除对象的属性与方法
- c#创建对象并动态添加属性
- EditText动态添加图片-----SpannableString来设置超链接、颜色、字体、图片属性
- bootstrap 动态添加验证项和取消验证项
- iOS分类中通过runtime添加动态属性
- Runtime(动态添加属性)
- 关于cxGrid针对于某一列转属性成Combobox后对于Items添加内容用代码的写法
- {}、:、[]、.的用法、动态给对象添加和删除属性、遍历对象的属性
- 动态给json添加属性
- Python 动态添加属性及方法
- javascript动态添加、修改、删除对象的属性和方法