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.

Get dynamic input value in gform_pre_render

  1. Hi.
    I have this booking form here: http://buffetkompagniet.dk/bestilling/.
    If I choose "Svane buffet" under Buffet some deserts and starters will appear in two extra select boxes.
    If I then fill out the rest of the form on step 1 and come back from step 2 to step 1, the starters and deserts select boxes are there but are empty. This is happening because gform_pre_render is run every time I go between steps. However this is where the select boxes are prefilled with data. How can I prevent gform_pre_render from running everytimes I go between steps? Or how can I pass the selected buffet starter choice back to gform_pre_render, so I can render the right data back into the select boxes.

    I am really stuck on this one. Hope some can help. :-)

    Vayu

    Posted 9 years ago on Monday November 21, 2011 | Permalink
  2. I think I sort of solved it, but in an ugly way and it is too complicated to share. Sorry, I would normally share, but I don't even know where to begin. I didn't find a way to make gform_pre_render render only once though.

    Vayu

    Posted 9 years ago on Tuesday November 22, 2011 | Permalink
  3. Do you need any help or are you satisfied with the solution you came up with?

    For multi-page forms, you can run code with the gform_post_paging hook:
    http://www.gravityhelp.com/documentation/page/Gform_post_paging

    Posted 9 years ago on Tuesday November 22, 2011 | Permalink
  4. Hi Chris, thanks for asking and for the tip, I appreciate that.
    Wonder why I didn't notice this hook gform_post_paging when I was setting it all up in the first place, or maybe I did and just have forgotten about it.
    Anyway, I am pretty happy with my solution and I can't spend more time on this project, so I'll leave at it is for now.

    Thanks
    Vayu

    Posted 9 years ago on Tuesday November 22, 2011 | Permalink
  5. OK, glad you got it.

    Posted 9 years ago on Wednesday November 23, 2011 | Permalink

This topic has been resolved and has been closed to new replies.