EasyUI Forum
May 21, 2024, 03:24:55 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: validatebox - disable focus  (Read 15378 times)
devnull
Sr. Member
****
Posts: 431


View Profile
« 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.

Logged

-- Licensed User --
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 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.

Logged
devnull
Sr. Member
****
Posts: 431


View Profile
« Reply #2 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
Logged

-- Licensed User --
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 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();
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!