I have a panel with bunch of controls in it and when I run the form in Chrome, scroll down to one of the controls on bottom and click a button, browser directly focuses to the first element in my panel. It isnt happening on IE11.
How can I fix this?
Focusing to the first element
Moderators: Jon, Steve, Ian, Dave
-
- Ebase User
- Posts: 331
- Joined: Mon Mar 10, 2014 8:34 am
-
- Moderator
- Posts: 421
- Joined: Fri Sep 07, 2007 3:44 pm
- Location: Sandy, UK
- Contact:
Hi,
Focus will only be gained to the first enterable field if the page is first loaded or you go to a new page.
I tested a form with some enterable fields on and a button. I click the button and this is the behavior:
Chrome - This focuses to the first enterable field.
Firefox - Does not focus on the enterable field, leaves the focus on the button.
IE 11 - Does not focus on the enterable field, leaves the focus on the button.
I believe that Firefox and IE is correct. Chrome is not.
To gain focus to my enterable field in all 3 browsers above I added:
to the bottom of my script.
This worked in all 3 cases.
Steve
Focus will only be gained to the first enterable field if the page is first loaded or you go to a new page.
I tested a form with some enterable fields on and a button. I click the button and this is the behavior:
Chrome - This focuses to the first enterable field.
Firefox - Does not focus on the enterable field, leaves the focus on the button.
IE 11 - Does not focus on the enterable field, leaves the focus on the button.
I believe that Firefox and IE is correct. Chrome is not.
To gain focus to my enterable field in all 3 browsers above I added:
Code: Select all
controls.MyControl.requestFocus();
This worked in all 3 cases.
Steve
0 x
-
- Ebase User
- Posts: 81
- Joined: Thu Jul 30, 2015 12:44 pm
Who is online
Users browsing this forum: Bing [Bot] and 7 guests