Show field value inside HTML

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
Katy
Posts: 145
Joined: Wed Dec 02, 2015
Location: Canada

24 Sep 2019

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.

User avatar
mnikitina
Posts: 264
Joined: Wed Jun 05, 2019

24 Sep 2019

Katy,

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

Katy
Posts: 145
Joined: Wed Dec 02, 2015
Location: Canada

24 Sep 2019

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.

User avatar
mnikitina
Posts: 264
Joined: Wed Jun 05, 2019

26 Sep 2019

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.

Katy
Posts: 145
Joined: Wed Dec 02, 2015
Location: Canada

26 Sep 2019

o! Wow!! that is even better then i expected!
Thank you very much!!!

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 8 guests