Appnitro Software Forums » MachForm

Adding Hidden Variables to MachForms

(2 posts)
  • Started 1 year ago by MrLinguaFranca
  • Latest reply from redityo

  1. MrLinguaFranca
    Member

    Hello all,

    I've just started using MachForms and am up and running but need your help with something. Sending forms is seldom just a one page but requires passing variables from one page to another. On the previous page the user selects a date range and then they click 'Continue', whereupon they're taken to my registration form (created on MachForm). I need my MachForm to pick up that date variable from the previous page because I want it to appear in the resultant mail.

    I read a post here that suggested selecting the 'Admin Option' could be used to make a hidden form field but I haven't had any luck with this. They simply keep appearing as text fields.

    So, does anyone know how to do this?

    Thanks in advance.

    Pete.

    Posted 1 year ago #
  2. Hi Pete,

    How you parse the data from previous form to registration form ? do you use "GET/POST" method ? If it's so let say you have "registration form" with this url :

    "http://www.yourdomain.com/registration.php"

    I assume you send GET data from your previous form, the url should be like this :

    "http://www.yourdomain.com/registration.php?data=2009-01-01"

    To get that variable data, you should edit "view-functions.php". If you consider you use "text field" you can go to around line 40, you will see this code :

    $element_markup = <<<EOT

    put this code exactly above that line

    if (!empty($_GET['data']) && $element->id == '1' && $_GET['id'] == '2')
    {
    	$element->default_value  = $_GET['data'];
    }

    in there I assume text element id = '1' in form id = '2', make sure you've change with yours

    Posted 1 year ago #

RSS feed for this topic

Reply

You must log in to post.