Question
5
Replies
340
Views
Posted: April 15, 2019
Last activity: July 23, 2019
Closed
Solved
Need to shift the focus to top after setting page set messages (Validations)
Hi ,
I am doing some validaitons(Page set messages) in a activity on click of button which is present on a harness , however the messages are set to the top of the page but now the user needs to scroll manually to the top to see the messages .Is there any way were we can shift the focus to top when the primary page has any message to it .
Thanks in Advance
Hi Ravi,
Can you try to call the window.scrollTo(0,0); javascript code to focus the page to the top and see if that satisfies your need. If you want to specifically focus the error message that is displayed at the top of the page then you can try to find the element which contains this error message and try to focus on it.
Something like, document.getElementById("ID").focus();
Let me know if that helps you.
Regards,
Mahesh M