This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 4

Passing parameter from one form to a second form


  1. johnlaidlaw
    Member

    I have inserted a url in the Submission Confirmation page to take the user to a new form:

    view.php?id=13904" I wish to prepopulate a field on the new form with the submission id from the just submitted form.

    In post_functions.php I have ammended line 1691 to read:

    $process_result['form_redirect'] = $form_redirect . '&IDNo=' . $table_data['id'];

    where 'id' is the field I wish to copy to the new form

    In view_functions.php after line 4381:

    $element[$j]->default_value = htmlspecialchars($row['element_default_value']);

    I have inserted:

    if($form_id == 13904 && $row['element_id'] == 17){ $element[$j]->default_value = $_GET['IDNo']; };

    Where the field I wish to prepopulate is element_17.

    Something is not connecting. If I change $_GET['IDNo'] to a value, it will prepopulate the field. However I can't seem to pick up the value if the 'id' from the old form.

    Posted 10 years ago #
  2. yuniar

    If you are using v4, there is no need to do any modification.

    You can use template variables to populate field values:
    http://www.appnitro.com/doc-url-parameters

    You can also use template variables to construct your "Redirect URL"
    This way you'll be able to pass data from one form to another.


    MachForm Founder

    Posted 10 years ago #
  3. johnlaidlaw
    Member

    Thanks Yuniar,

    I have literally just spotted the new V4 function enabling use template variables in the Submission Confirmation. This now works for what I need on this occasion.

    I also spotted that the entry ID no is not called 'id' but 'entry_no' so my modification wasn't going to work anyway! I have changed this as well but it still seems not to work for some reason, but its not critical now as the new functionality has solved the problem anyway.

    Many thanks.

    Posted 10 years ago #

RSS feed for this topic

Reply