Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Using a two-page multi-page Gravity Form with AJAX. I have an issue with one of my dropdown's clearing it's $_POST value on submit.

I have:

  • A US States dropdown - loading dynamically via 'gforms_pre_render' hook and modifying the $form object by adding choices
  • A Cities dropdown - dynamically loaded via pure javascript using .on() based on the value of the US States dropdown, no hooks or modifying the $form object.

When I hit "Next" on the first page of the form, here's what part of the $_POST variable looks like:

array(size=20)
  'input_1' => '3bed'
  'input_2' => '12/12/2013'
  'input_3' => '33331'
  'input_4' => 'Kentucky'
  'input_5' => 'Frankfort'

When I hit "Submit" on the second page of the form, here's what the $_POST variable looks like when my cities dropdown clears:

array(size=20)
  'input_1' => '3bed'
  'input_2' => '12/12/2013'
  'input_3' => '33331'
  'input_4' => 'Kentucky'
  'input_5' => ''

Any ideas on why this is occuring? Or perhaps I can be doing it differently? I was thinking that I might need to modify the $form object with all the cities choices when I click "next on the first page, but I'm not sure how to access the $form object to make sure those cities get in there.

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.