
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2017 01:20 PM
Hello,
Hopefully, this is an easy question. I am still learning JavaScript and have no experience with AngularJS. Anyway, I am trying to hide the 'Submit' button on a form within Service Portal. Basically, the response on a specific question will determine if the user should be filling out a different form or not. If true, then they are given a widget pop-up window with a hyperlink to the form that should be using. This appears based on a UI Policy and makes the remaining fields on the form Read Only, however, the user is still able to submit the request. I haven't been able to find a way to hide or make read only the 'Submit' button in the Service Portal. I have found how to via CMS but not Service Portal. There is similar request to hide the button on the Service Portal from but the button is hidden based catalog item and it appears to use AngularJS. I can't figure out how to modify the code and then hide based on a condition. I am not even sure if I can hide it with the Widget that I am calling by UI Policy or if I should be using a completely different process/method. Could you help with the method and code that I should be using?
Request Form:
Widget: (see attached for larger copy)
UI Policy:
Thank you,
-Wesley
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2017 02:21 PM
Hi Wesley,
There are couple of options which you can try :
- Clone OOB "SC Catalog item" widget and add your custom validation for "Submit" button.
- Add onSubmit Catalog client script and you can give alert message and using "return false" statement. User will not be able to submit the request.
3. Declare below function in your custom widget (software development tool)
and call this function from UI policy whenever you want to hide. Note : you can add another function for show.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2017 09:29 AM
You may try "angular.element('button[name="submit"]').css('visibility', 'hidden');" instead hide() function.
But this is not suggested way (DOM manipulation), you should clone OOB widget and modify according to your business use case.
Thanks,
Chirag

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2020 04:45 PM
hey Chirag,
I tried the same exact thing, but I got js error
js_includes_sp.jsx?v=08-06-2020_0931&lp=Mon_Aug_17_11_04_35_PDT_2020&c=19_802:41464 (g_env) [SCRIPT:EXEC] Error while running Client Script "hide show submt button": ReferenceError: hideSubmitBtn is not defined
Any ideas?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2020 04:44 PM
hey Wesley,
I tried the same exact thing, but I got js error
js_includes_sp.jsx?v=08-06-2020_0931&lp=Mon_Aug_17_11_04_35_PDT_2020&c=19_802:41464 (g_env) [SCRIPT:EXEC] Error while running Client Script "hide show submt button": ReferenceError: hideSubmitBtn is not defined
Any ideas?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2021 08:34 AM
Hi SN Emy,
Sorry, missed your request for help. Were you able to resolve your issue and get it working?
-Wesley