Anonymous
Login
XSnippets
OpenNTF
XPages.info
Development Contest
Share your Code with others
XSnippets Home
My Favorites
XSnippets by Popularity
Best rated XSnippets
Most recent XSnippets
XSnippets by Language
XSnippets by Author
Create XSnippet
Follow XSnippets
XSnippets Contests
►▼
My Favorites
Set focus on input field
You have to login first to use 'My Favorites' feature
So far, noone has added to favorites
try { dojo.byId("#{id:inputName}").focus(); } catch (e) { }
Select XSnippet to copy to Clipboard
Notes
Sets the focus (cursor) in the specified field. The code won't throw an error if the field can't be found of can't get the focus.
In the sample code "inputName" is the id of the input control you want to set the focus on.
Language
JavaScript (Client)
Author
Mark Leusink
Rating
Downloads
85
All code submitted to OpenNTF XSnippets, whether submitted as a "Snippet" or in the body of a Comment, is provided under the
Apache License Version 2.0
. See
Terms of Use
for full details.
Embed XSnippet
Report
Add to Social Business Toolkit
No comments yet
Login first to comment...
Related Twitter Tweets
Hosted by OpenNTF
Terms of use
Privacy Policy
Contact
Follow OpenNTF