Reputation: 51
I have a button in html, I added a variable to its link and I want to retrieve it from gravity forms.
<div>
<a href="/test/?test name">
</div>
Upvotes: 0
Views: 2218
Reputation: 1
I put together a tutorial on this at craftedplugins.com/gravity-form-url-parameters/
Once you set up the field to be populated dynamically and add the parameter name, you can add the parameter string to the URL.
To call this parameter, simply adjust the URL in the link or button to the page with the following sequence.
https://example.com/?parameter1=valuea
For multiple parameters to prefill, utilize “&”:
https://example.com/?parameter1=valuea2=valueb
If your parameter value is 2 words, use “+” between the words:
https://example.com/?parameter1=first+second
For Checkbox options/values, seperate multiple selections with commas and no spaces. “include=item1,item2,…”
https://example.com/?checkbox=option1,option2,option3
Hope it is helpful!
Upvotes: 0
Reputation: 633
In gravity forms edit mode, click on the field you want to populate with the parameter. Under the "advanced tab", click the "Allow Field to be Populated Dynamically" checkbox.
Add your url parameter, in this case, 'test_name'.
Make sure your url link looks something like this:
href="/test/?test_name=Mike"
Assuming your gravity form is embedded on the "test" page, you should see your field populated with the string, "Mike".
Upvotes: 2