Resetting/Emptying variable values onSubmit

nomadie
Kilo Expert

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','');
}
11 REPLIES 11

I did but it keeps on clearing value on the RITM and Task.

JR Guieb
Tera Expert

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".