The following mandatory fields are not filled in:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2017 08:37 AM
Hi community,
I want to set focus on the mandatory field if it is not filled by the user after click on Save/Update button,
Please find the snapshot below,
Here I just want to focus the Resolution Code if it is not filled by the user.
Like that the focus should be set on the first mandatory field based on the error message.
How to do that?
Please help me.
Thanks,
AnnBel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2017 08:52 AM
in html / js its done like this
document.getElementById("mytext").focus();
so if theres a varible, you'' have to find its atcual ID eg.IO:6868 (by clicking on view source page
or inspect element F11)
and use it
document.getElementById("IO:0989078904645645").focus();
but this'll not work in Portal..
.focus() method is not build on SN, due to some very good reason..
so I would suggest avoid using it and use the pop-up message
Still, in SN you can use the in- build method showFieldMsg
you may try the below code too..
document.getElementById('sys_original.incident.number').focus();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2017 08:53 AM
HI Anna,
Please provide the more information on your requirement
you want to make a Resolution Code is mandatory
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2017 09:05 AM
Hi Anna,
Or you can focus instead on the tab where the fields are. If the fields are in the first tab from the left, use in your UI action:
g_tabs2Sections.setActive(0);
If they are on the second tab, use
g_tabs2Sections.setActive(1);
etc.
harel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2017 10:55 PM
HI All,
harel ben-sheffer,chandu telu,Shiladitya Ghosh
Thanks for your response.
I just want to know the place where they have written these error messages & likewise the code to make the focus on the first mandatory field.