Client script snippets
Quick answer
Browser-side helpers you reuse constantly.
Key takeaways
- Make a field mandatory
- Hide a field
- Show a message
Browser-side helpers you reuse constantly.
Make a field mandatory
g_form.setMandatory('short_description', true);Hide a field
g_form.setDisplay('u_extra', false);Show a message
g_form.addInfoMessage('Saved successfully');Want to learn this properly?
Our live, instructor-led ServiceNow Training covers this hands-on, with real projects and a certification path.
Check your understanding
Which makes a field required client-side?
- A. g_form.setMandatory()
- B. gs.info()
- C. gr.update()
Show answer
A. g_form.setMandatory()
g_form.setMandatory toggles requiredness.
g_form runs where?
- A. In the browser
- B. On the server
- C. On the MID Server
Show answer
A. In the browser
g_form is a client-side API.
Frequently asked questions
What does the term Client script snippets refer to in ServiceNow?
Browser-side helpers you reuse constantly.