- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2016 12:46 PM
Hi,
i created a custom table with few fields. i decided those fields to 2 tabs.
i was able to hide / show one of the tabs depending on a value in a certain drop down field.
Does anyone know how i can set focus on a tab - so when i change the value of the filed, the tab will open but also get focus?
Thank you
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2016 01:13 PM
Hi Eli,
I found this which may be helpful.
How do I auto-select/auto-focus a section when I click an UI Action or onSubmit C/S?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2016 12:53 PM
Hi Eli,
I recommend you try focusing on one of the fields on one of the sections (tabs.) This should help.
Modifying Form Focus - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2016 12:58 PM
Hi Chuck,
can you recommend how to set a focus on a field? for some reason i was not able to do that.
thank you!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2016 01:05 PM
Hi Eli,
You would use a client script. However I misspoke, that other link is not a good solution. While it allows you to set the focus on a field, it doesn't work if the current section is not selected.
To set the section focus, see the method setSectionDisplay() here.
Useful Form Scripts - ServiceNow Wiki
This would go inside a Client Script (most likely an onLoad or onChange client script.
Client Scripts - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2016 01:09 PM
Hi Chuck,
yes, i used this function in order to show / hire the section/ tab - however it does not set focus on the section / tab - it just hide / show it, but the user start on the current open section / tab.