web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :

Programmatically adding html content snippets via JavaScript on to an Advanced Form Step (Dynamically adding instructions on to a form)

Oguz Erdeve Profile Picture Oguz Erdeve

Use Case

Consider you have a lot of forms with fields and for each field you want to add special instructions(html code snippets).

And you want to create one instruction and reuse it for multiple places.

First here is how the final solution looks like:

I override the Currency Field label with instructions from the html code snippet

pastedimage1653154852645v1.png

Here is a possible way to accomplish this:

1. Create an html code snippet(you are free to use multi line html with href tags)

pastedimage1653155006660v2.png

Here is the html of the code snippet

4137.pastedimage1653157600074v1.png

2. Enter the code below for overriding currency field label on the advanced form step JavaScript

2845.pastedimage1653157679595v2.png

(See attached code file)

You will need to replace
Snippet Name (in my example I used “SampleField_Instruction”)You will need to replace
FieldName (in my example I used “transactioncurrencyid_label”)

As for the explanation of what I am doing here:
I am starting with closing the javascript tag because I am going to wrap the html code snippet around with an invisible div.
My div has a style display none which hides the div.
Then I start with a new javascript tag 
Then I am getting the inner html from the invisible div and assigning it to the currency label

Comments

*This post is locked for comments