Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Request.Form..?

Status
Not open for further replies.

kenjoswe

Technical User
Sep 19, 2000
327
SE
Hi all,

I have a simple request: Search=Request.Form("Search").

If I have a variable, lets say, "Much More" then the "Search" variable only contains "Much".

If it is a space in between, the variable only takes what is to the left in the Request.Form("Search")

How can I solve this?

/Kent J.
 
Sorry,
I don't understand.
How should I use this in my example.

This is what I have tried:
Search=Request.Form(Server.URLEncode("Search"))

But I still get "Much" instead of "Much More"

/Kent J.
 
What is the submitting form? Is it using a Post or a Get? Probably it is either using Forms with a Get or just a plain querystring. Whatever the case, either change it to POST or when the variable is set in the submitting page use Server.URLEncode method.

Example:
Submitting Page:

Code:
<form method=get action=&quot;page.asp&quot;>
<input type=hidden name=Search value=&quot;<%=Server.URLEncode(&quot;Much More&quot;)%>&quot;>
<input type=submit>
</form>

OR

Code:
<a href=&quot;page.asp?Search=<%=Server.URLEncode(&quot;Much More&quot;)%>&quot;>Link</a>

Retrieving Page:

Code:
Search = Request.Form(&quot;Search&quot;)

Without the Server.URLEncode, anything after the first space will be lost.
Wushutwist
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top