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.

Using Hidden Fields

  1. I am trying to send some hidden fields with my form, but I cannot for the life of me figure out how to do it. Basically, these are the fields I need to transmit to my payment processor:
    <INPUT TYPE="HIDDEN" NAME="store_id" VALUE="123456">
    <INPUT TYPE="HIDDEN" NAME="hpp_key" VALUE="123459">
    <INPUT TYPE="HIDDEN" NAME="charge_total" VALUE="113.00">

    Any help would be most appreciated!!!

    Posted 12 years ago on Friday July 22, 2011 | Permalink
  2. Where are the values that you want to populate these hidden fields coming from?

    You can't add HTML markup to your form. So you can't add hidden fields this way.

    To add a hidden field to your form you would edit your form, and add a Hidden Field to your form using the form editor.

    To then populate the hidden fields dynamically you take a look at this tutorial:

    http://www.gravityhelp.com/documentation/page/Using_Dynamic_Population

    Gravity Forms is a dynamic form builder so it's not the same as creating a form from scratch. You can't control the field id's and input names. So to integrate with a 3rd party service you can't just change the form action and input names to submit to that 3rd party service. You have to do so using custom code and available API hooks/filters.

    Posted 12 years ago on Friday July 22, 2011 | Permalink
  3. The fields are static for each form, not dynamic. Am I correct in understanding that I cannot pass on static fields?

    Also, as I understand you, I cannot pass a field with the name "store_id". Is that correct?

    Posted 12 years ago on Friday July 22, 2011 | Permalink
  4. If the field values are static then you'd enter the value as the default value for the hidden field in the form editor.

    But you are correct, you can't change the name or id of inputs in Gravity Forms. It's a dynamic form builder, it controls the name and id's of inputs as part of it's form processor.

    If you want to integrate with a 3rd party service you have to do so using custom code. I'm not entirely sure what you are trying to do, or who you are trying to integrate with so it's difficult for me to know how you can do what you are trying to accomplish.

    How are these fields going to be sent to the 3rd party you are trying to integrate with? Because Gravity Forms submits to itself, how are you planning on passing this data to the 3rd party?

    Posted 12 years ago on Friday July 22, 2011 | Permalink
  5. I am using a payment service calld moneris. I have been using html forms I developed, and to pass on the form information I use:
    <FORM ACTION="https://www3.moneris.com/HPPDP/index.php" method=post>
    I have named my form fields so that they pass on to moneris, eg. such field names as name, email, rvar1, rvar2, etc.
    When I try using the hidden field, it does not seem to have an option to set a default value as static. The drop-down list only seems to have variables, based on GF field names.

    Posted 12 years ago on Friday July 22, 2011 | Permalink
  6. You aren't going to be able to implement this the same way with Gravity Forms. With Gravity Forms you don't control the input names/ids and you don't control the form action. Gravity Forms processes the form, which means it controls the form action. If you want to integrate with a 3rd party service you have to do so another way through the use of custom code.

    I'm not familiar with Moneris so I don't know the best way to do this using their simple integration method. I do know they have an API which means you could integrate with them via their API and available Gravity Forms API hooks but that would require knowledge of how to work with API's and write the necessary PHP to do so.

    If Moneris can work via a GET request rather than just a POST request you could configure your form confirmation to REDIRECT to Moneris and pass the field values in the query string, which gives you complete control over the names that are passed. But you'd have to check with Moneris to see if this is possible, if it is then this would be the simplest way to handle it.

    Posted 12 years ago on Friday July 22, 2011 | Permalink
  7. Thank you so much for your help on this Carl. Now I understand far better how GF works. I do have a workaround in place right now, whereby I use an intermediary page through which I pass the GF data, adding the static information along the way. It works, but I was trying to cut out a step. I think I'll just leave that other step in for the time being. The path of least resistance....

    Thanks again and have a good weekend!!!

    Posted 12 years ago on Friday July 22, 2011 | Permalink

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