EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: xuexiaodong on July 08, 2015, 08:33:31 PM



Title: how to change the required options
Post by: xuexiaodong on July 08, 2015, 08:33:31 PM
 in real using ,sometimes one input is required,sometimes the  input is not required.
so i do as this
Code:
  $('#requiredType').combobox({
                onSelect: function (param) {
                    if (param=1)
{
   $('#DrpHA').combobox({ required: false });
}
else
{
$('#DrpHA').combobox({ required: true });
}
                }
            });

am I created the combobox more than once?
if i creates more than once, how to chang the options?

and i find if i hide the required input ,but when i post the form ,it will find the $("form").form('validate') is false,can not post the form


Title: Re: how to change the required options
Post by: stworthy on July 09, 2015, 07:29:11 AM
You can call '.combobox' and pass a config object to re-create the combobox component. If you only want to disable the validation, please call 'disableValidation' method instead.
Code:
$('#cc').combobox({...});
// $('#cc').combobox('disableValidation');