PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

passing form items from page 1 to 2

  1. So, I've created a multipage form where:
    I ask the user on page 1 to enter height, width.
    I want to dynamically fill in a field on page 2 containing the area (ie height*width).
    I've made my own wordpress add_shortcode function which returns using:

    [=area height="variable1" width="variable2"]

    which I want to use as a dynamic field on page 2

    How can I fill in variable1 and variable2 coming from page1?

    (set form to ajax)

    Posted 12 years ago on Thursday May 3, 2012 | Permalink
  2. Have you tried using our calculation types yet for this? You can use a number field that is set to calculation that can multiply the two values and give you the result that will show in that number field.

    Posted 12 years ago on Thursday May 3, 2012 | Permalink
  3. Thanks for your quick response Rob, I didn't.

    Passing a variable from a page 1 field to a shortcode in a page 2 field would solve my problem on the other hand.

    (I've got much more complicated formulas in an Excel style sheet plug-in which I made in the last couple of weeks, and want to use as a result in a page 2 field coming from page 1 field (as a variable))

    thanks.

    Posted 12 years ago on Thursday May 3, 2012 | Permalink
  4. As I needed a read only field with the calculated value I've solved this issue using gform_field_input

    - Works fine but some feedback on the method would be appreciated! Also I get a html break between the field label and the input box after returning the $input. Can't seem to find were this is generated. Anyway, gravity forms did the trick! Like it.

    functions.php in theme:

    add_action("gform_field_input", "field_updater", 10, 5);
    
    function field_updater($input, $field, $value, $lead_id, $form_id)
    {
      // change text field to read only and set value only for field 14 and pagenumber 2.
    
    	if ($field['id'] == 14 && $field['pageNumber'] == 2 )
    	{
    	  $calculation =  do_shortcode('[=calculate_me value1="'.$_POST['input_1'].'" value2="'.$_POST['input_2'].'" value3="'.$_POST['input_3'].'"]');
    
     	  $input = '<input READONLY type="text" tabindex="12" class="large" value="'.$calculation.'" id="input_2_14" name="input_14">';
    
    	  return $input;
    	}
    Posted 12 years ago on Monday May 7, 2012 | Permalink