cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Can I use Live Form data in Success/Cancel message form?

Jump to solution

Ok, I have a nice working Live Form. What I now need to accomplish is to show data from the Live Form on either the Confirmation or Cancel message page. It allows to insert Properties, but as they either not yet exist while on the Live Form, or are not yet available for other reasons, they show up empty. This includes an automatically generated reference number (intending to use JS and "new Date().getTime()") to be stored in a (hidden/disabled form field).

If the above is possible, what am I missing???

NB: I searched the community but could not find any help so far.

0 Kudos
Reply
2 Replies
Workflow Hero

Re: Can I use Live Form data in Success/Failure message?

Jump to solution

For now I'm using an alert in the Submit button's Client Click function

0 Kudos
Reply
Workflow Hero

Re: Can I use Live Form data in Success/Failure message?

Jump to solution

Ok, another solution is to use either localStorage or sessionStorage. Difference is that the latter is cleared as soon as the browser session is closed while the former behaves similarly to cookies, be it that it allows for more data to be stored. For my purpose it is sufficient to use a sessionStorage variable.

In the form's Custom JavaScript add a line, for example in the Submit button's Client Click function, where you assign your field's value to a sessionStorage variable:

      sessionStorage.myField = NWF$("#" + jsMyField).val();

Next, go into the Live Settings\Confirmation Message and edit the message's HTML source:

  • add a paragraph tag with an id: <p id="myField"></p>
  • At the end add the following JavaScript snippet:

                <script type="text/javascript">

                      document.getElementById("myField").innerHTML = 'The value of myField: ' + sessionStorage.myField;

                </script>

Reply