PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Spaces stripped from query string values

  1. I'm using the redirect on submit and query string features to create a "search" type form here - http://www.jamsinternational.com/panellist-search

    If you type more than one word into the "Keyword" field and submit, for example "Arbitration Mediation" the resulting query string on the next page shows "ArbitrationMediation" with the spaces removed.

    Can you advise how I can make the query string retain/encode spaces? I saw a cuple similar questions when searching the forum, but I couldn't find a definitive answer.

    Any help is greatly appreciated, thanks!

    Posted 12 years ago on Thursday December 22, 2011 | Permalink
  2. That has not been my experience. In fact, I set up a form just a day or two ago to do just this. Here's the form:

    http://gravity.chrishajer.com/google-search/

    Submit search terms with spaces and you'll see they get converted to plusses for the query string.

    I submitted your form and I see that it is removing the spaces in the search terms. Can you post the links to the topics where you read about similar problems? I recall this happening but can't recall a specific resolution.

    I see you're using Gravity Forms 1.6.2 and WordPress 3.2.1 which should both be OK. I wonder if you search from the preview, do the spaces get stripped out of the query string? Also, can you try with the default theme rather than the WooTheme? Thanks.

    Posted 12 years ago on Friday December 23, 2011 | Permalink
  3. Thanks for your help, your test form works great for me. Unfortunately I haven't been able to figure this one out yet as I'm still seeing space in my keyword submission.

    http://www.jamsinternational.com/panellist-search

    I suppose I could try using hooks to see at what stage this is happening and try and prevent it. Any other ides?

    Thanks again!

    Posted 12 years ago on Tuesday January 10, 2012 | Permalink
  4. Using the hooks to dump the object is a good idea. Do you need help selecting one? Seems like you need the gform_pre_submission to see what was submitted by the user, and then also something for the confirmation redirect to see what is actually present there.

    Posted 12 years ago on Tuesday January 10, 2012 | Permalink
  5. Thanks for the reply Chris, I'll try that and see what I come up with. I'm familiar with using the GF hooks but I'll let you know if I have any troubles. Thanks again!

    Posted 12 years ago on Thursday January 12, 2012 | Permalink