I have a form that asks users to consent to their data being processed by a variable entity based on their country. I need to setup the form so that once a lead selects their country from the dropdown, the in the next field dynamically populates the entity with the country.
So for eg. I as a lead, go to this form. I select Canada as my country from the dropdown. Once I do that, the next field in the form dynamically autopopulates this text: "I consent to (company name) Canada to use my data"
I tried to accomplish this by using the lead country token within the form but it sometimes showed the default value even when country was filled out for a lead. Sometimes it worked.
Also important to note is that this is a guided landing page, and the dynamic content is contained within the form, not on the landing page.
Any help is appreciated!!
Solved! Go to Solution.
Exactly like so:
MktoForms2 :: VRs and templated output
Where the HTML of the output field's label is:
I consent to SpenceCo <output for="Country" name="brandedConsent"></output> using my data.
And the Visibilty Rule:
Hi Kiah,
Tokens will not help here. They could only be populated after the form is submitted to the database.
You will need some javascript to do this.
-Greg
Hi Gregoire, thanks for your reply! What if we already have the lead country in our database? It worked a few times with tokens but other times it showed the default value even when we already had country populated for that lead in our database. Is this the behaviour you would expect? Thanks so much!!
Hi Kiah,
Is the lead country is in the database, the token will populate, but I do not recommend you do this: if the person updates her country the token will not be updated.
The default value might be explained if you have duplicates in your database, or if the lead cannot be identified with the munchkin cookie.
-Greg
Exactly like so:
MktoForms2 :: VRs and templated output
Where the HTML of the output field's label is:
I consent to SpenceCo <output for="Country" name="brandedConsent"></output> using my data.
And the Visibilty Rule:
Nice one
-Greg
Hi Sanford, thank you so much for your response! I'm trying to figure this out, but I keep getting an empty value for country. Where do you suggest I place the JS? Do I need to put both the JS and HTML you provided in the code? Thanks again!
The HTML is in the Rich Text area.
The JS from the CodePen goes into a separate <script> tag.
Got it. Thanks so much!!