- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2023 11:28 AM
Hello,
I am new to servicnow. I create a catalogue request, in Catalog Client Scripts, I have onLoad scripts like this
function onLoad() {
//Type appropriate comment here, and begin script below
g_form.setVisible("charge_back", false);
}
to set this variable to be hidden on the form,
but when the form submitted, I want to change this hidden variable to be saw on RITM
so I add onSubmit scripts in Catalog Client Scripts, like this
function onSubmit() {
//Type appropriate comment here, and begin script below
g_form.setVisible("charge_back", true);
}
but this onSubmit script didn't work, the variable didn't show up in RITM.
Anyone can help? Thank you very much
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2023 05:33 PM
Hey Rui,
You dont need to create an onSubmit Catalog Client Script. Instead, edit the existing onLoad client script that you have so that it only displays on the Catalog Item View, which means once it is submitted the code to hide 'charge_back' will not run.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2023 05:33 PM
Hey Rui,
You dont need to create an onSubmit Catalog Client Script. Instead, edit the existing onLoad client script that you have so that it only displays on the Catalog Item View, which means once it is submitted the code to hide 'charge_back' will not run.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2023 07:14 PM
Hi Ethan,
Thank you very much. it works!