How to get values of fields and put it on an HTML field?

MelvinBulan
Tera Contributor

I have these fields. 

MelvinBulan_0-1669648926864.png

MelvinBulan_1-1669648970304.png

 

Is it possible to have these values to be put in an HTML field on the same form?

Basically inside the < >

MelvinBulan_3-1669649044114.png

 

 

Will an onChange script do? Can someone kindly please help me with the script.

 

 

 

 

3 REPLIES 3

Aman Kumar S
Kilo Patron

Hi @MelvinBulan 

You can populate the html field as below:

var htmlBody="<p>Location: "+g_form.getDisplayValue('server_location')+ "<br>" + "Manager: "+ g_form.getDisplayValue('manager')+ "<br>" + </p>";// verify the correct backend names of the field
g_form.setValue("field_name",htmlBody);// apply the correct field name

 

 

Best Regards
Aman Kumar

Hello Aman,

Do I create an onChange or onLoad client script for this? Since I want it to show only when those fields are filled up. If so then it will run the script.

I have tried it with an onChange, but when I select an option

MelvinBulan_0-1669650715521.png

 

It wont show up in the description HTML field:

MelvinBulan_1-1669650742625.png


Update: So I tried an onLoad,

MelvinBulan_0-1669650961934.png


It showed up now but I wanted it so that when the "server location" field is selected, it will show up on the description HTML field. Is it possible? Why is using an onChange didn't work?

 

Hello @MelvinBulan 

From where you are filling server information. From portal or platform view?

 

Thanks!