Best approach for moving the cursor to next field.

Lon Landry4
Mega Sage

I am trying to write a client side script for a catalog item that can move to the next field once populated with a value.

So, more or less simulating pressing the tab key once the field is populated.

I know the keycode for the tab key is 9. 

 

I have tried approaches object.onkeydown from stack overflow but could not make it work with ServiceNow.

Ideally I need it to work in portal, but if platform is best that I can do - that would be fine...

Any idea how to achieve this in ServiceNow?

 

Thanks for your time,
Lon

 

1 ACCEPTED SOLUTION

Lon Landry4
Mega Sage

This did not work at first but now no issues...

g_form.getControl(variable').focus();

View solution in original post

1 REPLY 1

Lon Landry4
Mega Sage

This did not work at first but now no issues...

g_form.getControl(variable').focus();