Focus on worknotes on click of UI action!

Neeraj_27
Tera Guru

Hi Community!

How do get I get the cursor/focus into 'work notes' onClick of UI action?

I have tried using var refocus=g_form.getElement('work_notes');

refocus.focus(); and also tried 

g_form.getControl('work_notes').focus(); but none of the things are working!

Btw, I'm trying this in the Tokyo version!

Thanks,

 

2 REPLIES 2

H_9
Giga Guru

Hi,

Please check the following article on known issue with .focus() from servicenow.

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0694100 

 

If above link does not help you then the better option would be to check the "client" checkbox on the UI action and in the client part of the script, make the work_notes mandatory, this will automatically take the focus to this field once the Ui action is clicked and if this field is empty.

 

Please mark the answer correct if above explanation helps you.

Thanks. 🙂

Hi H_9,

Tried this already but not working !

Thank for the reply!