您的位置:首页 > 其它

combobox动态添加必填属性验证

2015-08-14 11:01 357 查看
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/hailang2513/article/details/47658755       今天遇到为combobox动态添加必填属性验证,简要说明一下:

我原来的代码是:
        
<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});



                                                                                                                                                                                                                    此稿是个人经验,仅供参考,如有差错,望不吝赐教!

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: