g_form method focus() not working on Additional Comments field

Milan13
Giga Expert

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

find_real_file.png

 

1 ACCEPTED SOLUTION

Omkar Mone
Mega Sage

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

View solution in original post

9 REPLIES 9

Are you able to share screenshot of the client script form?

Omkar Mone
Mega Sage

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

Milan13
Giga Expert

Hi both,

after unchecking "isolate script" in my client script form this works:

var comments = gel("activity-stream-textarea");


if (comments){
comments.focus();
}

It focuses on the "Notes" part of the form however the blinking cursor is not present in the additional comments field itself, however this is still good (don't even know if it's even possible to have a blinking cursor present using the "focus" method...)

 

Appreciate your help,

Milan

Seems to be working just fine.

Thanks again!

Milan

We're glad that we were able to help 🙂