EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: devnull on March 31, 2013, 06:55:41 PM



Title: validatebox - disable focus
Post by: devnull on March 31, 2013, 06:55:41 PM
How to disable the setting of focus onto the first validate box ??

I the forms, the focus should be set onto the first element in the form and not to the first validatebox in the form.



Title: Re: validatebox - disable focus
Post by: stworthy on April 01, 2013, 02:53:44 AM
Calling the form's 'validate' method will set the focus on the first invalid input. If you want to focus to the first input element, don't call 'validate' method or set focus to first input element manually after calling 'validate' method.



Title: Re: validatebox - disable focus
Post by: devnull on April 01, 2013, 10:56:58 PM
Thanks, but I am not calling validate, it seems that the form.load() method automatically validates when it is called.

Is it possible to disable validation so that I can decide when validation is done and when it's not ??

Thanks


Title: Re: validatebox - disable focus
Post by: stworthy on April 02, 2013, 07:29:09 PM
When calling 'load' method, the form will do the validation to let the user know if the data is correct. An alternative way to solve this issue is to focus to what input element you want after calling 'load' method.
Code:
var f = $('#ff');  // the form object
f.form('load',{...});
f.find('input:first').focus();