# Access Dynamically Inserted Hidden Input within GFPaymentAddOn()?

**URL:** <https://community.gravityforms.com/t/access-dynamically-inserted-hidden-input-within-gfpaymentaddon/13274>\
**Category:** Get Help\
**Tags:** custom, gfpaymentaddon, payment\_token\
**Created:** [August 19, 2022, 3:04pm UTC](https://community.gravityforms.com/t/access-dynamically-inserted-hidden-input-within-gfpaymentaddon/13274 "2022-08-19T15:04:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![user5a710077bd6911.6](https://avatars.discourse-cdn.com/v4/letter/u/48db29/32.png) [@user5a710077bd6911.6](https://community.gravityforms.com/u/user5a710077bd6911.6)\
**Post date:** [August 19, 2022, 3:04pm UTC](https://community.gravityforms.com/t/access-dynamically-inserted-hidden-input-within-gfpaymentaddon/13274/1 "2022-08-19T15:04:09Z")

</div>

I’m working on updating a payment plugin that uses card tokens instead of card numbers.

The vendor loads a JS script on that page that has the user input card information. This script then generates a single-use encrypted token that gets submitted for processing instead of the card number.

After the user completes the token generation the script performs two actions:

1. callback a js function with the response included obscured card number and token
2. Inserts a hidden field with the id payment\_token and value of the token

I could create a JS function that populates a known GF form field with this token data, but it seems to be easier to just read the hidden field that is inserted into the form; but i’m having trouble sorting out how to access this.

Since the input is being dynamically generated and then inserted into the form do I need to create a filter/hook to grab the input and add it to the $entry object?

Is there an easier way?

---

<div class="post-metadata">

**Author:** ![richardw8k](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/richardw8k/32/2354_2.png) [@richardw8k](https://community.gravityforms.com/u/richardw8k)\
**Post date:** [August 22, 2022, 9:04am UTC](https://community.gravityforms.com/t/access-dynamically-inserted-hidden-input-within-gfpaymentaddon/13274/2 "2022-08-22T09:04:06Z")

</div>

The values of custom inputs aren’t available in the entry so you need to grab them directly from the `$_POST` using the input name e.g.

`$value = rgpost( 'payment_token' );`

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/gravityforms1/original/2X/f/fef63f0599c45e0218c30d9f5d7ca8bff9b00189.png) [@system](https://community.gravityforms.com/u/system)\
**Post date:** [September 21, 2022, 9:04am UTC](https://community.gravityforms.com/t/access-dynamically-inserted-hidden-input-within-gfpaymentaddon/13274/3 "2022-09-21T09:04:32Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
