We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20041
    • 83 Posts
    Hi all!
    How do I display a "Thank you, NAME, ...." after the user has submitted the form. How do I get the value on to the name variable. Can I display it on the same page?
    I am using eform.
    Any help is welcome.
    Thank you.
      • 32963
      • 1,732 Posts
      Hi,

      You can use a snippet to retrieve name value from the postback form, store it inside a session variable then use the same snippet to display the name on another form:

      Example:

      Create a snippet call SaveForm with the following code:

      $field = isset($field) ? $field : '';
      if($field!='' && count($_POST)>0) {
      	// saved postback value to session
      	$_SESSION['SaveForm_'.$field] = $_POST[$field];
      }
      else {
      	// retrieve saved value from session
      	$value = isset($_SESSION['SaveForm_'.$field]) ? $_SESSION['SaveForm_'.$field] : '';
      	unset($_SESSION['SaveForm_'.$field]); // clear the session
      	return $value;
      }


      on the page with the eForm add

      [[SaveForm? &field=`Name_of_field`]]

      Where Name_of_field is the name of the form field to be saved.

      On the page where you want to display the saved field add

      [[SaveForm? &field=`Name_of_field`]].







        xWisdom
        www.xwisdomhtml.com
        The fear of the Lord is the beginning of wisdom:
        MODx Co-Founder - Create and do more with less.
        • 20041
        • 83 Posts
        rolleyes Thank you, xwisdom. I got it right with the SaveForm snippet. Thanks a million!!!