Access form data in Form Confirmation Dialog?


#1

Is there a simple way to access the data from a form in the Form Confirmation Dialog?

From what I can tell, I can’t append the form data as URL parameters for the iframe src when using the Form Confirmation Dialog. I also don’t see any form data in the global window.ub object after submitting.

Use case: I’d like to send some custom events via JS from within the Form Confirmation Dialog, and need email address, etc, to make it possible.

Apologies if this is redundant - I searched and found related topics, but nothing specifically about this.

Edited to add: I found an unanswered post from 2011 asking this same question, so confidence in this being possible is low: How to access form field data from a thank you page script?


#2

Just spitballing here… but could you not get the values of the form inputs on change and append them to the href attribute as Get variables?


#3

Hi @TimothyDO - thanks for the suggestion, I mostly follow what you’re saying. The issue is - when using Unbounce’s built in Form Confirmation Dialog, the submit button is just triggering some behind-the-scenes JavaScript to open the modal, so it’s tricky to pass through form data upon submit. If I was sending users to a second URL with a full page refresh, I could just use Unbounce’s “append form data as URL parameters” option, but I’m hoping to be able to accomplish this from within the Form Confirmation Dialog.


#4

Hi there,

You can use dynamic keyword insertion to display data from your form on your confirmation popup.

Here is a link with an explanation and a short video tutorial.

Best,
Hristian


#5

Hi @Hristian - thanks for this tip. However, I’m looking to use the form data inside a snippet of JavaScript, so I don’t think the dynamic text option will work in this case (please correct me if I’m wrong.)


#6

Hi @w_r_e_f_s,

Yes, the DKI won’t probably work in this case but since you have control over the page, form and confirmation dialogue you can write JS that will display anything you want.

Best,
Hristian