Show/Hide Submit button on Catalog Item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2020 02:10 PM
Hi,
I have been tasked with creating a form that when this form loads the submit button is hidden. Then after specific fields have been validated based on an onChange clients script that I created to validate information inputted by the user, if it is correct then the submit button will show for the user to submit the form.
Is there a simple way to do this? I know that many have said in other post to copy the OOB widget but this is just for this one specific form only.
I know that I can set it to block the user from submitting, but my VP wants me to see if the submit button can be hidden instead until validated.
Any help would be appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2020 02:15 PM
This would not be best practice especially because Servicenow does not recommend DOM manipulation.
By the way , do you want this in Service Portal/Native ServiceNow UI/Both.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2020 04:43 PM
This would just be in the Service Portal for one of the forms. Is there any way to do it that would fall into best practice?
It is only to make sure that the user does not submit the form.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2020 06:28 PM
Hi,
I can understand the point of view from your VP, but in terms of best practice, it's not an ideal situation.
Also, as a side note, you do this one...it becomes the norm (I've seen this before).
Also, as another side note, I can almost guarantee users will report this to your help desk that the form is broken, etc. (because on 99% of the other forms...this isn't the behavior...).
If your VP doesn't want the user to be able to submit until fields are "properly" filled out, then you would control that through UI Policies and Client Scripts.
You can "assist" the user a bit by indicating that the form can't be submitted until 'x,y,z' just to give an additional "heads up" beyond just required fields, etc.
So there's things you can do that are more appropriate.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2020 09:03 PM
Hi Dazler,
Take the reference from below code and replace your logic.
my logic is "if value of audit checkbox is true" then button should be visible otherwise it should be hidden.
1. Important thing is to achieve this you have to make the value of Isolate Script = false;
2. Bring this Isolate Script field on client script form : form layout.
Client Script Code :
Kindly Mark Helpful and Correct If it works.
Thanks