Focus Indicator

srisaiteja
Tera Contributor

How can i change the focus indicator in the "Create New Incident" page to the different field, like "Service Offering," in the page 
Now it is default set to the "Number."

I think i can do it On load client script, But it not going through

 

image.png

 

Please share me the insights, if any

 

1 ACCEPTED SOLUTION

Community Alums
Not applicable

Hi @srisaiteja ,

You're right — to change the focus to a different field like "Service Offering" when the "Create New Incident" form loads, you can use an onLoad client script.

 

tryy this  script :

function onLoad() {
    setTimeout(function() {
        var field = g_form.getControl('service_offering');
        if (field) {
            field.focus();
        }
    }, 300);  
}

 

  • g_form.getControl('field_name') returns the HTML element of the field.

  • 'service_offering' must be the actual name of the field (not the label).

  • Delay using setTimeout helps if the field is not immediately available when the form loads.

  • Make sure your script is scoped properly and there are no console errors.

Yes, it’s possible using an onLoad client script + a small timeout. Make sure the field name is correct and visible on the form.

 

View solution in original post

2 REPLIES 2

Community Alums
Not applicable

Hi @srisaiteja ,

You're right — to change the focus to a different field like "Service Offering" when the "Create New Incident" form loads, you can use an onLoad client script.

 

tryy this  script :

function onLoad() {
    setTimeout(function() {
        var field = g_form.getControl('service_offering');
        if (field) {
            field.focus();
        }
    }, 300);  
}

 

  • g_form.getControl('field_name') returns the HTML element of the field.

  • 'service_offering' must be the actual name of the field (not the label).

  • Delay using setTimeout helps if the field is not immediately available when the form loads.

  • Make sure your script is scoped properly and there are no console errors.

Yes, it’s possible using an onLoad client script + a small timeout. Make sure the field name is correct and visible on the form.

 

Thanks Tejas its working