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.

Put calculated value in a field

  1. webdesignsalemoregon.com/surveytest

    When you go through this test, it will add up whether you are a Self, Other, or Socially aware person.
    Is there a way to get this result (currently displayed with "return $confirmation") to populate a Custom Field that's hidden from the user?

    currently, I've got this

    http://pastie.org/3312298

    at the bottom of my Functions.PHP file

    Posted 12 years ago on Friday February 3, 2012 | Permalink
  2. Hi, thirdriver,

    I think what you want to do is instead use the gform_pre_submission hook (http://www.gravityhelp.com/documentation/page/Gform_pre_submission). In this hook you can actually modify the $_POST values. You could create a hidden field on your form. Loop through the data like you are doing and put your calculated value into the $_POST data for that field. This hook fires before the notification message is sent and the entry saved. You can either use the merge_tag for you hidden field in the email notification setup in the admin, or still use your confirmation hook to grab the data instead out of the field you populated in the gform_pre_submission hook.

    Take a look at that hook and let me know if you have any questions.

    Posted 12 years ago on Friday February 10, 2012 | Permalink

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