Solved

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

Posted on 2007-12-03
4
156 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
4 Comments
 
LVL 29

Accepted Solution

by:
Göran Andersson earned 500 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

This article discusses four methods for overlaying images in a container on a web page
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

759 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now