Gravity Form Dynamic Content URL Encode

We are using the Form Integration element, with field values pre-populating.
image

location={{dc:post:meta key=“invite_location”}}

Sometimes, this location contains a single quote. like “Jane’s House”. This single quote breaks the input. Gravity is only receiving “Jane”. (Verified by inspecting the hidden field on the page.)

I didn’t see any way in the docs to tell the dynamic content to translate the output to URL encoded, which does work. (tried with manually inputting “Jane%27s%20House” and verifying it in the page inspector) What’s the best way to do this?

I wasn’t actually able to reproduce this and it worked using Jane's House, but ideally the escaping happens automatically if needs to. Can you send me the full Field Values or a site to look at? Thanks have a great day.

Added the full string as a secure note for client privacy!

“combined_invite_date” is a plain text, as is hosted_by. If that doesn’t give you any clues I’ll add site access info & layout cornerstone link to the secure note.

Sorry that was also working for me. Could I see the site? I’ll have time next week to see it happen. If you feel like trying out Twig you can probably get around this with the url_encode filter. It would be the dynamic content below.

{{ post.meta({"key":"invite_location"}) | url_encode }}

Unfortunately, we aren’t on PHP 8.1 yet. Need to do some backups and testing before that can happen. (At some point we had something on the server that broke horribly on update.) Appreciate you taking a look!

1 Like

Hi @glindacreative,

You are most welcome. Please let us know if you need any further help with this.

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