onchange client script in catalog form to clear the entered text

Dhanush Rao K
Tera Contributor

Hi 

 

I want to write a client script  for clearing the entered text in variable of catalog item

 

DhanushRaoK_0-1723454811492.png

Whenever we are selecting "others" then "please specify" field will be displayed and we are going to enter the required text.

If we are going to select different option rather than "others" and again selecting "Others" then the previous entered text remains same.

 

Can anyone helpme out to write a Onchange client script for clearing those entered text for the above scenario.

 

Regards,

Dhanush

6 REPLIES 6

Anubhav24
Mega Sage
Mega Sage

Hi @Dhanush Rao K ,

You can write a UI Policy where you write a condition when to execute Team is Others and then under UI Policy Action you can control the visibility of Please Specify field, set Visible to true and then there you have the option of clear value as suggested by @Weird 

Please mark helpful/correct if my response helped you.

Amit Verma
Kilo Patron
Kilo Patron

Hi @Dhanush Rao K

 

UI Policy is the best and no-code approach to your requirement. Define a UI Policy on the variable Team Changes and in the UI Policy action, ensure that you check Clear the Variable Value checkbox.

 

Thanks and Regards

Amit Verma


Please mark this response as correct and helpful if it assisted you with your question.