FORMfields, the premiere web framework
Login
Support Home | Knowledge Base | Documentation | Forums | Contact Us
Info
FORMfields & FORMgen :: Field Customizations

Passing Form Data to Another Form

(1238 views. Last Updated: 2008-12-22 10:01 PM)

There are multiple ways that form data can be passed to another form. Here are just a few of them:

1. Using a query string. Let's say you have the field:
$ffForm->addField(new PersonNameField("employee_name", "Employee Name", FORM_FIELD_REQUIRED));
you can pass the value of the field to another form by using a URL like:
http://mysite.com/otherForm.php?employee_name=<?= $ffForm->getValue("employee_name"?>

2. Using a session. You can use the PHP global variable $_SESSION to store and then retrieve your entire form instance. For example in the 1st form you could use:
$_SESSION["my_form"] = $ffForm;
and then in the second form:
$ffForm = $_SESSION["my_form"];

3. Using a database. Please see http://www.formfields.com/FORMfieldsArea/FORMfields3/tutorials/loadFromDb.php for details on how to load/unload form data from/to a database.
Info
Support | Earn Money
Copyright © 2005-2019 Brain Book Software LLC.
Built with FORMfields, the premiere web framework.