Title: Validate combobox on form submit? Post by: joe on July 05, 2017, 11:39:13 AM How do i validate a combobox only on form submit? Here is the code i use to submit the form.
Code: $('#ff').form('submit',{ I initialized a combobox like this and it is validating as soon as the form is loaded. I only want it to validate it on form submit: Code: $('#CityGroup').combobox({ Title: Re: Validate combobox on form submit? Post by: jarry on July 05, 2017, 05:02:41 PM Please look at this example https://www.jeasyui.com/demo/main/index.php?plugin=Form&theme=default&dir=ltr&pitem=Validate%20on%20Submit&sort=
Title: Re: Validate combobox on form submit? Post by: joe on July 05, 2017, 09:21:02 PM Thanks for your replay. The combobox on the example doesn't have a default selection, ie "- Select City -". See my example, if I set the "required:true" attribute, the "- Select City -" default selection is a valid selection. If I set the "validType: 'notFirst[\'- Select City -\']'", the combobox will show as an invalid selection as soon as the form load.
I only want the combobox to validate during on submit. Title: Re: Validate combobox on form submit? Post by: patana on July 10, 2017, 10:09:31 PM Let try:
First extend check validation to check when user key in. Code: $.extend($.fn.validatebox.defaults.rules, { Add Code: validType="check['#company_name']" Define id=0 to your default text "- Select City -" In my case i load data from server so i will do like: Code: $item = array('id'=>'0','text'=>'- Select City -'); For form submit: Code: $('#fm').form('submit', { |