I have a multi page form where I’m prefilling a bunch of field values via the gform_pre_render filter.
On page 1 I’m able to change default values all good.
foreach( $form['fields'] as $field ) {
switch ($field->id) {
case 22:
$field->defaultValue = 'My prefill value'
...etc
However on page 2 and beyond this approach doesn’t work Re: this response by @richardw8k Pre-select checkbox options/choices on form load - #8 by richardw8k
So I’m successfully prefilling the values using that approach, like
$_POST['input_65'] = 'My Value';
And it’s all groovy, fields are being prefilled as expected. However…
If the user changes one of the prefilled values that was prefilled using $_POST the submission still contains the old prefilled value in the db. And the post_submission $entry object still references the old prefilled value.
So how do I keep prefilling fields past page 1 (eg with $_POST) and still allow my users to change these values and have these saved on submission?
Thanks!