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.

Dynamically Populating Price with gform_post_paging?

  1. theslink2000


    I've been trying to build an order form based around dynamic selection of a patients medications. I've got all the code working behind the scenes so far, however I can't seem to get it to populate the price field.

    I'm using a multi-page form where the first page is dynamically populated with a patients medications from the database as checkboxes likes this:

    Then on the second page it checks to see how many checkboxes have been ticked and then multiplies that by a preset prescription charge. The only way I've found of doing this is using the gform_post_paging hook as the basic gform_field_value hook outputs $_POST data multiple times for some reason. When I dump the information (seen in the order_prescription_cost function) it prints all the correct information as floats, however the gform_post_paging hook won't update the price field. Here's the code:

    I can't understand it, I've found a thread on here ( that states the gform_post_paging hook can be used like gform_pre_render, but it's not responding at all.

    Can someone please help!

    Posted 10 years ago on Wednesday October 10, 2012 | Permalink
  2. theslink2000

    For anyone finding this the answer was both weird to me and simple. You can achieve this using the gform_pre_render hook, which I would never have thought to use as the price is built on the second form page based on activity from the first form page. However, here's the working code:

    Posted 10 years ago on Wednesday November 7, 2012 | Permalink
  3. Thank you for sharing your code.

    Posted 10 years ago on Monday November 12, 2012 | Permalink
  4. theslink2000

    No worries bud, you guys helped me sort it in a priority support ticket and I hate it when I find forum posts with no answers.

    Just hope it helps someone.

    Posted 10 years ago on Monday November 12, 2012 | Permalink

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