Forms Module - Display user data in "After submit text"

edited October 2017 in Modules
Hi,

We would like to display data that the user has entered in the "After submit text".

Example:

Dear {firstname}{surname},

Thank you for your interest.

Click here to download the bid document.

//{mydoc} is a hidden input field obtained from get parameter in the form URL

We would be most grateful if you could advise us on how we can achieve this.

Thank you.

Comments

  • edited 1:40PM
    You may want to look at creating a separate page altogether and using the "return_url" parameter to point to that. There is a flashdata called "posted" which will have all the posted data information in which you can merge into that page.
  • edited 1:40PM
    Hi admin,

    Thanks a lot for your support.

    We have created the static page in fuel/application/views and pointed the return_url to that page and this part works ok. We are trying to output the posted flashdata in the page as below but it is not showing. Getting error instead.

    var_dump($this->CI->session->flashdata('posted'));

    We would be most grateful if you could let us know what we could be doing wrong.

    Thank you.
  • edited 1:40PM
    What's the error that you are getting?
  • edited 1:40PM
    Hi admin,

    This is the error below. We also tried to echo it from a controller method and encountered similar errors.

    Thank you.

    ====================================================

    A PHP Error was encountered

    Severity: Notice

    Message: Undefined property: MY_Loader::$CI

    Filename: views/download-form-complete.php

    Line Number: 7

    Backtrace:

    File: /public_html/fuel/application/views/download-form-complete.php
    Line: 7
    Function: _error_handler

    File: /public_html/fuel/modules/fuel/core/Loader.php
    Line: 396
    Function: include

    File: /public_html/fuel/modules/fuel/core/Loader.php
    Line: 323
    Function: _ci_load

    File: /public_html/fuel/modules/fuel/core/Loader.php
    Line: 462
    Function: view

    File: /public_html/fuel/modules/fuel/libraries/Fuel_pages.php
    Line: 998
    Function: module_view

    File: /public_html/fuel/modules/fuel/controllers/Page_router.php
    Line: 169
    Function: variables_render

    File: /public_html/fuel/modules/fuel/controllers/Page_router.php
    Line: 74
    Function: _remap_variables

    File: /public_html/index.php
    Line: 364
    Function: require_once
    A PHP Error was encountered

    Severity: Notice

    Message: Trying to get property of non-object

    Filename: views/download-form-complete.php

    Line Number: 7

    Backtrace:

    File: /public_html/fuel/application/views/download-form-complete.php
    Line: 7
    Function: _error_handler

    File: /public_html/fuel/modules/fuel/core/Loader.php
    Line: 396
    Function: include

    File: /public_html/fuel/modules/fuel/core/Loader.php
    Line: 323
    Function: _ci_load

    File: /public_html/fuel/modules/fuel/core/Loader.php
    Line: 462
    Function: view

    File: /public_html/fuel/modules/fuel/libraries/Fuel_pages.php
    Line: 998
    Function: module_view

    File: /public_html/fuel/modules/fuel/controllers/Page_router.php
    Line: 169
    Function: variables_render

    File: /public_html/fuel/modules/fuel/controllers/Page_router.php
    Line: 74
    Function: _remap_variables

    File: /public_html/index.php
    Line: 364
    Function: require_once

    Fatal error: Call to a member function flashdata() on a non-object in /public_html/fuel/application/views/download-form-complete.php on line 7
    A PHP Error was encountered

    Severity: Error

    Message: Call to a member function flashdata() on a non-object

    Filename: views/download-form-complete.php

    Line Number: 7

    Backtrace:


    ==================================================
  • edited 1:40PM
    Try just referencing the $CI object and not $this->CI:
    var_dump($CI->session->flashdata('posted'));
  • edited 1:40PM
    Hi,

    We tried that as well and still got same type of error.

    We tested another way by creating a session userdata for the form post to show it in the view and clearing the session data once it has been displayed.

    Thanks a lot for your support.
Sign In or Register to comment.