Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Set focus to the short_description field when incident form loads

Servicenowr2266
Giga Contributor

 

// Set focus to the short_description field when incident form loads
g_form.getControl('short_description').focus();....\its not working

1 REPLY 1

Ankur Bawiskar
Tera Patron

@Servicenowr2266 

g_form.getControl() should work

try to give some timeout so that form loads by that time

function onLoad() {
  setTimeout(function() {
    g_form.getControl('short_description').focus();
  }, 1000);
}

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader