473,322 Members | 1,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Creating a URL encoded value in JavaScript

I'm working on a web application which needs to submit information to the
server via a URL string. The URL can contain values retrieved from form
input fields. I'm using the escape function to preprocess values from
input fields, but I have a problem when the input field contains a '+'
(plus sign). Since the escaped value gets put into a URL, the server
doesn't see the '+', but rather a blank. Is there any other javascript
function which will automatically escape a '+' in addition to the other
characters that it already escapes?

Thanks.

--
James Howe
Jul 23 '05 #1
1 2542
On 06 Apr 2004 16:31:06 EDT, James Howe
<co************@wingspread.imap-mail.com> wrote:
I'm working on a web application which needs to submit information to
the server via a URL string. The URL can contain values retrieved from
form input fields. I'm using the escape function to preprocess values
from input fields, but I have a problem when the input field contains a
'+' (plus sign). Since the escaped value gets put into a URL, the
server doesn't see the '+', but rather a blank. Is there any other
javascript function which will automatically escape a '+' in addition
to the other characters that it already escapes?


The simplest thing to do is convert plus symbols to their hex-escaped
versions first, then use the escape() function. When you perform the
reverse, convert plus symbols to spaces, then use unescape().

Mike

--
Michael Winter
M.******@blueyonder.co.invalid (replace ".invalid" with ".uk" to reply)
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Michael | last post by:
I am trying to integrate my ASP page with an external application that sends me a QueryString that is URLEncoded and each Name and Value in the QueryString is Base64 Encoded as well. ...
5
by: Vandana Rola | last post by:
Hello Everyone, I am a beginner in Javascript.I want to create fun quiz tool using javascript (no database). The feature of that tool is every question has five choices. The user needs to select...
26
by: Protoman | last post by:
How would you use a lookup table of char*, I mean, how would you find out where the intersection of D and E is? And how would you read two strings, and parse each character. Here's the array: ...
7
by: Julia | last post by:
Hi I am trying to pass an encoded string to a JavaScript the following is the C# code which convert the string STRING_TO_ENCODE to base64 byte bytIn =...
6
by: Chris Fink | last post by:
I have an xml document that contains some elements encoded as Base64. How do I dynamically scan the XML Document and pull out the sections that are Base64... My overall goal is to display the...
1
by: wingsforwheels | last post by:
Prior to posting a form (.asp page) to a URL, I check the parameters being passed and they are not encoded, but when the URL is served it is encoded. How can I prevent this? The code is as...
3
by: yeah1279 | last post by:
I recently changed our web pages to be utf-8 encoded (server response header content type is also set to utf-8). There are some links to external sites within the pages that pass parameters that can...
5
eragon
by: eragon | last post by:
I wrote this function to create a new file when the user posts in my forums, and its not creating a new file, can you help me? this script is not copyrighted as the last one. function...
1
by: skyson2ye | last post by:
Hi, guys: I have written a piece of code which utilizes Javascript in PHP to create a three level dynamic list box(Country, States/Province, Market). However, I have encountered a strange problem,...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.