[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 429
  • Last Modified:

get Element focus / know where the focus is

Hey Experts!
 
The workflow in my case is the following: I have a input box and a dropdown box. When I input something in the input field a submit takes place and by return from the server the value is shown in the dropdown. I have the problem however that by return the focus in not anymore in my input field. I would like to have though this :)
How can I get this the input in the field back?

Thanks!

0
dlcnet
Asked:
dlcnet
  • 2
1 Solution
 
biztigerCommented:
Say the id of your input field is i1. Now after you perform the submit request, call :-

$("#i1").focus()
0
 
dlcnetAuthor Commented:
I do ... the problem is that the element does not get it :(
0
 
biztigerCommented:
It should. Can you please post the code.
0
 
rajvihariCommented:
you can setFocus property set with input box or dropdown box after fatching data from server.
or after the value return from server.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now