• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 327
  • Last Modified:

Drupal 7 Use Form Stored Values

Sorry for the question but I'm still relatively new to PHP. :)

I'm using Examples For Developers code: form_example_wizard.inc

to create a multi-page registration wizard.

Stored values are passed in step_information from each page. I'd like to use a couple of values from the first page to populate data on the second page. How do I extract specific items from the store_values array(i.e name)?
form-example-wizard.txt
0
kjenney
Asked:
kjenney
  • 2
1 Solution
 
kjenneyAuthor Commented:
Stored values are stored in each step using the $form_state. To get the "name" entered in on the first form the code is as follows:

$myname = $form_state['step_information']['1']['stored_values']['name'];

Open in new window


Any other value is easily extracted by changing the value name and/or step number (here it's 1).
0
 
kjenneyAuthor Commented:
Trial and error..got it!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now