The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Replace %20 ?

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #35461

    I’v got some trouble here. I am saving the window.location.searc(…) in a variable and inserting the variable as a value in a textbox. If the content transferred in the URL ( has spaces, they get replaced with %20. Me no likey. Any way to replace all %20 in the textbox with ” “(space) . And yes, it has to be in a textbox.

    The code work’s, and this is not directly copied, it’s by memory. So please do not comment if I wrote the code wrong or something, because it works. Once again, just want to fix “%20” problem.

    Just to clarify, this is for example if I load the page with the code above like this: is location search thingy
    It will come out as


    Try this:

    var savedInfo =;
    document.myform.myinput.value = 'Some text ' + decodeURI(savedInfo) + '';

    Thanks, I’ve been wondering about that.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.