Web Analytics Made Easy -
StatCounter Removing the '+' from passed data - CodingForum

Announcement

Collapse
No announcement yet.

Removing the '+' from passed data

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Removing the '+' from passed data

    This has most likely been answered before so apologies but I couldnt find it, basically, I have a form that passes data to a second page where it calculates stuff, and part of the first form asks for 2 names, but when these appear on the 2nd page they have a + sign between the first and surname as obvioulsy this is how the URL passes the data over. How do I get around this other than splitting the First and Surname into separate fields. Thanks in advance.

  • #2
    tmpStr = tmpStr.replace (/\+/g, " "); // replace + sign(s) by space(s)

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

    Comment


    • #3
      OK thanks, but does that need to sit inside a function as it dont work (sorry, still on the curve)

      Comment


      • #4
        Yes, it must be within a function and of course within <Script> tags.

        You did not post any code so I am not able to be more specific.
        tmpStr is simply the name of the string containing the name data.

        All the code given in this post has been tested and is intended to address the question asked.
        Unless stated otherwise it is not just a demonstration.

        Comment

        Working...
        X