Resetting/Emptying variable values onSubmit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2020 10:11 AM
I need to do multiple request/order of the same catalog form, using Add to Cart and I need to clear these two fields everytime I click on the add to cart button.
Catalog Client Script doesn't work clearing/resetting/emptying the variables because it affects the RITM/SCtask form too... Would you know other way to fix this? I only need to clear 2 fields out of 5 variables/questions.
Catalog Client Script
Type: onSubmit
Applies on a Catalog Item view: True
Applies on Requested Items: False
Applies on Catalog Tasks: False
UI Type: All
function onSubmit() {
//Type appropriate comment here, and begin script below
g_form.clearValue('install_software');
g_form.setValue('new_hire_software_justification','');
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2020 04:52 AM
I did but it keeps on clearing value on the RITM and Task.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2021 01:36 AM
Hi,
Did you get this to work? I have the exact same requirement to clear only certain variables once the submitter clicks on "Add to cart".