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.

Field data into an HTML field?

  1. Hey Gang,

    Just bought GF...it's awesome! Here is my question...

    I am a photographer. I would like to use GF so users can create a "custom" contract. (A bride for example)

    So...I would like a bride to answer a number of questions, then on the final page of the form will be a custom contract with all of the data she just filled out in the contract. I would like to have an "email me this contract" button.

    Not sure how to do this...any advice?

    Rob :)

    Posted 14 years ago on Friday November 26, 2010 | Permalink
  2. You would need to pass the field values in a query string to a custom confirmation page. That page would have the basic contract, and then use PHP GET to populate the name, date, etc. with the variables passed from the form.

    ex: firstname={My Field:ID}&secondname={My Field:ID}&reservationdate={My Field:ID}

    It's not something that's really difficult, but you will need some basic PHP knowledge to put it together and make it work.

    http://discomoose.org/2005/10/19/how-to-use-the-query-string-in-php/

    http://www.keithjbrown.co.uk/vworks/php/php_p2.php

    If you need a good developer to help out, we'd be happy to suggest one for you.

    Posted 14 years ago on Friday November 26, 2010 | Permalink
  3. Edited - posted the same time as Kevin. He is wiser in the force...

    Posted 14 years ago on Friday November 26, 2010 | Permalink
  4. Currently, email notifications aren't conditional. They're either sent to the user or not dependent on the form notification settings. So, the checkbox suggestion wouldn't work without additional customization.

    The easiest method is to simply compose the contract in the notification section of the form and populate the appropriate sections with the field values. That would be sent to the recipient automatically. The same goes for the confirmation message.. use the basic message function to display the contract with the field values plugged in the appropriate locations.

    There are a couple of ways to do it, it just depends on how complex you want it to be.

    Posted 14 years ago on Friday November 26, 2010 | Permalink
  5. Yikes...this looks a little complex for me. :) Is there a way I can just insert the field data into an HTML block (like the last page of the contact form?)

    Rob

    Posted 14 years ago on Friday November 26, 2010 | Permalink
  6. Form field variables don't work in HTML blocks because the values don't exist until the form is submitted. So there is nothing to render in the HTML blocks. HTML blocks are part of the form, and until the form is submitted the values don't exist.

    Posted 14 years ago on Friday November 26, 2010 | Permalink
  7. Along the same lines of this question -- I am passing some data to the form, and I can have it auto populate one of the questions of the form, but I'd like to include that info in an html block instead. Can those variables be used in the html block?

    Posted 14 years ago on Wednesday May 11, 2011 | Permalink
  8. Currently variables can't be used in the HTML block. It doesn't support HTML. It does support shortcodes. So you may be able to write a custom shortcode that does what you want it to do. Write a custom shortcode that reads the query string for the value you want and have it output the value.

    Posted 14 years ago on Wednesday May 11, 2011 | Permalink