Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

Make field mandatory on submit (incident)

Snow Tomcal
Tera Expert

Hi All,

I have a field on the incident record that I want to make mandatory on form submitting.

I created a client script (onSubmit):

function onSubmit(){

g_form.setMandatory('field_name', true);

}

when I'm submitting it's turning to mandatory but after a few seconds the red asterisk disappears.

Does anyone know how to fix this?

 

Thanks 🙂

1 ACCEPTED SOLUTION

Raghav Sharma24
Giga Patron

Try below:

 

function onSubmit(){

g_form.setMandatory('field_name', true);

return false;

}

View solution in original post

2 REPLIES 2

Raghav Sharma24
Giga Patron

Try below:

 

function onSubmit(){

g_form.setMandatory('field_name', true);

return false;

}

It works, Thanks!