Modifier :urlencode
URL-encode the value. Example: {Company:101:urlencode} gives Acme+Widgets+%26+Co.+%3Cb%3ENorth%3C%2Fb%3E+Branch%2C+serving+the+%22Tri-County%22+area+since+1923. On the test form, this field is {Company:101} (Single line text).
About
| Product | Gravity Forms |
|---|---|
| Requires | Gravity Forms 1.9 or later |
| In the picker | Change the output, for form fields |
How to use it
Pass a value in a link
Spaces become +, and characters like @ and & are encoded, so the link still works.
Write
https://example.com/search?email={Contact Email:5:urlencode}&name={Full Name:1:urlencode}Get
https://example.com/search?email=ada%40example.com&name=ada+LovelaceExamples
Output from the real plugin code, run on a test entry.
| Merge tag | Output | Without the modifier |
|---|---|---|
{Contact Email:5:urlencode} | ada%40example.com | [email protected] |
Works on
Form fields: Single line text · Paragraph text · Email · Website · Hidden · Signature · Drop down · Radio buttons · Checkboxes · Checkboxes, one choice · Multi select · Image choice · Multiple choice · Post category · Number · Product · Product price · Quantity · Option · Shipping · Shipping (single) · Total · Date, after a custom format · Time · Name, one part · Address, one part · Phone, standard format · File upload · Post image · List.
Left out
| Field kinds | Why |
|---|---|
| Consent · Calculation · Product (single) · Product (hidden) · Name · Address | Outputs nothing on the whole field. Gravity Forms has no single value for this field as a whole, so the tag outputs nothing and so does any modifier. Use one part instead, like .3 for a first name. |
| Date | Needs a date format first. GravityView would change the stored date (2024-03-19), which has no letters. Add “Custom date format” or “Relative time” first. |
| Phone, international format | Works on the stored record. An international phone field stores a record like {"country":"US",…}. GravityView would change that record, not the number people see. |
| Repeater | Changes nothing on this field. It leaves this field as it is: a number has no letters and is one word, and a repeater is shown as a table these steps do not change. |