?
Solved

Using Get method to submit a form... problems with spaces.

Posted on 2007-12-03
4
Medium Priority
?
206 Views
Last Modified: 2010-04-09
Hi Gang,
I am using the get method to submit a form.  There is one drop down box and one text box.

Problem: When I submit the form, the url variable from the drop down box has spaces replaced with the plus (+) sign.  I need the spaces to be replaced with %20 instead.  Is there any way to do this?

Here is a sample of the code:
    <form method="get" action="http://test/results.aspx">
      <font face="Verdana, Arial, Helvetica, sans-serif" point-size="10">

        <SELECT class="select2" NAME="s" SIZE="1">
           <option selected value="">Search Scope</option>  
           <option value=All Sites>All Sites</option>  
           <option value="Internet web sites">Internet web sites</option>  
           <option value="">Intranet web sites</option>  
        </select>                        

        <input class="textbox3" type="text" name="k" size="50" value="" align="top">

        <input type="submit" value="Search" alt="Search the Enterprise" hspace="2">
      </font>
    </form>
0
Comment
Question by:dgmcpher
  • 2
3 Comments
 
LVL 29

Accepted Solution

by:
Göran Andersson earned 2000 total points
ID: 20399793
Not really...

The data is correctly encoded. Why would you need it do be encoded in any different way?
0
 
LVL 16

Expert Comment

by:rbudj
ID: 20400080
Just hard code the %20:

Search%20Scope
0
 
LVL 29

Expert Comment

by:Göran Andersson
ID: 20401353
> Just hard code the %20

Then it will be doubly encoded into "Search%2220Scope". When it's decoded you don't get "Search Scope", you get "Search%20Scope".
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question