setValue is not working HTML variable in catalog item

Mahesh Kumar2
Tera Expert

I have created a HTML variable in a catalog item. I am setting hyperlinks data to variable through client script based on a dropdown value change. It used to work as expected. When i change a value in dropdown, it shows the hyperlink in that HTML variable as in second screenshot. But suddenly it's stopped working may be from past few days. I am not sure any functionality deprecated wrt HTML variable. Attaching the code as below. Please help me on resolving this.

 

hyperLink.pngportal.png

8 REPLIES 8

Vrushali11
Tera Contributor

Hello @Mahesh Kumar2 

Instead of using setlink try using below:

var url;

url = <a href = 'add your url' >Title</a>

 

Use this url in your variable.

 

Regards,

Vrushali

Hi Vrushali, Thanks for the response.

 

setLink is the custom function written by me for just reusability. The issue here is, url variable which i am trying to assign with g_form.setValue() is not working for html field. I still need to use setValue with your approach which is not working.

Amit Verma
Kilo Patron
Kilo Patron

Hi @Mahesh Kumar2 

 

Please check on below points and revert with the findings :

 

1. Ensure that the client script is active and UI type is set to All

2. Put an alert before the if condition to check what you are getting in the new value. I doubt that none of the if conditions are matching as your drop down values might have changed.

 

Thanks & Regards

Amit Verma


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

Hi Amit,

 

I checked the mentioned things already with adding some alerts in between. Conditions are working as expected and value is getting picked. only the setValue part is not working i believe.