Page 1 of 1

Show field value inside HTML

Posted: 24 Sep 2019
by Katy
Hello,
This is probably very easy, but i can't make it work :-)
I need to show some of the values from the fields inside the text on the screen. I am trying to do it with HTML but can't make it work.
I've put this script inside html:
<script>
function myFunction() {
var myplant = document.getElementById('Plant_Num_Text');
document.getElementById("myplant").innerText = fd.field("Plant_Num_Text").value();
}
</script>

and this inside the text portion to show field: <span id="myplant"/>

field name is Plant_Num_Text.

Re: Show field value inside HTML

Posted: 24 Sep 2019
by mnikitina
Katy,

Is the text to which you want to pass the field value on the form? Or is it just somewhere on the page?

Re: Show field value inside HTML

Posted: 24 Sep 2019
by Katy
No, it's just a a text portion.... for example: "We have reviewed the financial statements for <Plant>." And there is a long paragraph where Plant is used several times, so the idea is that people populate "Plant" field along with the others and when they print out the form that text looks like just like a text piece with custom plant's name for each item.

Re: Show field value inside HTML

Posted: 26 Sep 2019
by mnikitina
Katy,

In 'Plain text' and 'Rich text' controls you can add field value by putting the field's internal name in square braces: [Title].

Your example: "We have reviewed the financial statements for [Plant_Num_Text]."

Note that it will work only if the data is saved.

Re: Show field value inside HTML

Posted: 26 Sep 2019
by Katy
o! Wow!! that is even better then i expected!
Thank you very much!!!