Recent searches
No recent searches
How to auto populate the content of Description
Answered
Posted Jul 22, 2021
Dear All,
I am able to set auto populate the content for Subject by below script but unsuccessful for Description. Would you please help me. I was stuck here few days already. I am not sure what is wrong with it.
The end-user interface as below.
The script.js as below.
1
11
11 comments
TAN BING
Btw find the "erquest-description" is inside iframe as below. How can we assign a value by add coding in script.js?
0
Trapta Singh
Hi @...,
Try replacing your code to set value for description with the below code.
Let me know how it goes for you.
Thanks
1
TAN BING
Dear Trapta,
It works. Tks very much.
Btw may I consult with you how to change the the font color for substring in the Subject and Description?
Rgds
Tan Bing
0
Trapta Singh
@...,
If the colour is not conditional then you can use the CSS. If it is conditional then you can use the below code to make the changes.
Let me know if this solves the purpose.
Thanks
0
TAN BING
HI Trapta,
Tks for your advice first.
I am able to change entire string color as below attachment. But i wish to change XXXXXXX substring portion as RED and others keep as BLACK. How will able to achieve it?
0
Trapta Singh
@...,
I don't think it will be possible for the subject field, however, for the description field, you must be passing the HTML in the setContent() function. You can simply put the class to wrap the XXXX text in the description field and then using
you can change the colour of the particular substring.
Let me know if you face any issue.
Thanks
1
TAN BING
Hi Trapta,
May I check with you how do we define a class in script.js? Can share some example for it?
0
TAN BING
Hi Trapta,
I have resolved it by HTML format. Tks for your help.
May I just confirm with you if it is not possible to change substring color in Subject field?
0
Trapta Singh
@..., I don't think it will be possible to change the substring colour in the subject field as it's an input field and uses string only not HTML content.
You can only change the colour of the whole string in the subject field and not just substring.
Thanks
0
TAN BING
Hi Trapta,
Tks very much for your help.
0
Trapta Singh
Glad to hear that I could help. Happy Zendesking :)
0