- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2019 05:18 AM
Hello,
I have an onChange() client script on "state" field - once this field is changed I need the cursor to be focused on "Additional comments" field however this does not work:
g_form.getElement('incident.comments').focus();
This method works for other fields however comments - label: Additional Comments field is according to dictionary located in task table, there is a dictionary override for this field as per below but not sure how this works...
Any idea how this works?
Many thanks,
Milan
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2019 10:06 PM
Hi
The solution that Raf provided, keeping the same, can you confirm if the isolate script checkbox on your client script is checked or unchecked? If it is checked, please uncheck it and try once.
Regards,
Omkar Mone.
www.dxsherpa.com

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2019 06:27 AM
Hi,
Can you try:
var refocus = document.getElementById('incident.comments');
refocus.focus();
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2019 09:37 PM
Hi Allen,
unfortunately it does not work as I am getting this message once changing state to "on hold":
onChange script error: TypeError: Cannot read property 'getElementById' of null function () { [native code] }
MAny thanks,
Milan

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2019 09:43 PM
Hi Milan,
Saw this on a previous post, give it a try:
var comments = gel("activity-stream-textarea");
if (comments){
comments.focus();
}
or/and
comments = gel("activity-stream-comments-textarea");
if (comments) {
comments.focus();
}
Regards,
Raf
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2019 09:56 PM
It does not work (none of thesse) unfortunately.
Thanks a anyway.
Milan