Passing a web address in a URL Parameter

I’ve been using URL parameters for a while to dynamically populate a form – and have dealt with encoding things like spaces and such for those things that are unusual. But, I’ve had some trouble with parameters that are a web address (e.g., urlForWebAddrField=http://www.acme.com)

Anyone done this? Are there particulars to passing a web address? (I’d imagine it’s the :// or . or / characters that would be the issue.

Thanks!

Neil

You will need to urlencode the value before you try to use that as a parameter, or a value, in a query string.

Thanks Chris! I was encoding, but in looking at what urlencode handles, there were some characters that I mistakenly missed in my “formula”.

That said, now that I have those, the fields in Gravity Forms are populated with values like this:

  http%3A%2F%2Facmecompany%2Ecom

instead of:

  http://acmecompany.com

Ideas?

I’d recommend opening a support ticket so we can dig into it.

Done. Thanks!

1 Like