Hide the Submit button on a record producer until a certain condition is met

Ben124
Tera Expert

Hello!  I'm trying to hide the submit button for just one record producer (creates an incident), but I only want to hide it temporarily.  There are going to be a bunch of choice options, and the next field won't appear if the wrong choice is selected.  If the end user makes it to the bottom and properly answers the last question, then I want the submit button to appear.  Is there an easy way to make this happen (an onLoad client script maybe?)?  I was looking through past threads, but nothing I saw seemed to be working.

1 ACCEPTED SOLUTION

https://community.servicenow.com/community?id=community_question&sys_id=091db558dbd7e3802e8c2183ca961931

View solution in original post

8 REPLIES 8

Sajilal
Mega Sage

I would advise against DOM Manipulations, better to use Onsubmit Catalog Client scripts for your validations to not allow users to submit without the required details configured in your Onsubmit client scripts.

Hope this helps!

Thanks,

Saji

Thank you for the advice.  However, for the nature of this form and for the direction given on how this form should function, the submit button needs to be hidden.

Try this code then document.getElementById("submit_button").style.display = 'none';

You would need a Onload Client Script and make sure the Isolate Scripts field is set to False on your Catalog Client script(The field would be in backend).

Please Mark as Correct if this solves your issue and also mark ???? Helpful if it helps resolve your problem.

Thanks,
Saji

The submit button is still there, and there is a javascript error on the form.  Plus, how would I make the button come back when the specific variable is answered correctly?

I appreciate the help!