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.

query string dash special character

  1. kumpan
    Member

    Hello.
    Im trying to pass a value using querystring so when i click on a link its value gets selected in a new page drop down list. I got it working but when i add a dash character to the value it stops working.
    I tried changing to url friendly character like & ndash ; also but that didnt help neither.
    Any ideas what i can do to make it work?

    Posted 12 years ago on Wednesday March 7, 2012 | Permalink
  2. Do you happen to have a link to your form and the link you are using to populate that form? I just did a quick test using a dash and it seemed to go ok:

    http://grab.by/cgwS

    Posted 12 years ago on Thursday March 8, 2012 | Permalink
  3. kumpan
    Member

    Thanks for your help.
    I tried to use dash with no spaces like you and it worked. But is it possible to make it work with blank spaces like: "Second - Choice"?
    (It works with one space in either side aswell but not with two.)

    Posted 12 years ago on Thursday March 8, 2012 | Permalink
  4. Indeed my friend, take a look at this:

    http://grab.by/cgII

    Just put %20 before and after the dash in your string.

    Posted 12 years ago on Thursday March 8, 2012 | Permalink
  5. kumpan
    Member

    Thanks for your reply.
    I tried to replace (also urlencode, str_replace, etc), but no luck. Here you can see the example, when you click "Intresseanmälan" at this page:
    http://www.vialatina.se/?resepaket=colombia-varldsarvsstaden-cartagena

    You get to a gravity form where the drop down "Resepaket" should be dynamically filled.
    Worth mentioning is that i also tried changing the populate_dropdown function in wordpress.

    Posted 12 years ago on Thursday March 8, 2012 | Permalink
  6. Looks like you have a typo in your link, in your query string it should be ?resepaket and you have: ?resepaketet.

    http://grab.by/chps

    Posted 12 years ago on Friday March 9, 2012 | Permalink
  7. kumpan
    Member

    If i change it to "resepaket" it ADDS the value to the dropdown. I just want to MATCH the value so it gets selected. (that dropdown is dynamically populated with the parameter name "resepaketet")

    Posted 12 years ago on Friday March 9, 2012 | Permalink
  8. Interesting, could you send me a login to rob@rocketgenius.com

    Posted 12 years ago on Friday March 9, 2012 | Permalink
  9. kumpan
    Member

    I can copy everything and put in another server and give you access, BUT before i go thru all that hussle, i found out something that might be of help.

    When i quickedit the post and update without even changing anything, it works like it should!

    When i update the post from regular edit screen (and rewrite the dash again in the title) it stops working.

    Maybe with this info you know a fix for this that doesnt involve quickedit/update every post?
    Let me know if you still want me to copy everything to another server and give you access.

    Posted 12 years ago on Friday March 9, 2012 | Permalink

This topic has been resolved and has been closed to new replies.