Asp forms and variables
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > IIS server support > IIS ASP > Asp forms and variables




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Asp forms and variables  
GwenP


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-22-04 12:47 PM

I am passing a variable from one asp page to another say "land registry". It
puts the variable in the URL (as land%20registry) as you'd expect.  I want t
o
add it to a hidden text box in a form so that I can then pass it back
(eliminating the need to store this original search variable in a cookie).
However even though I can response.write the variable as "land registry" on
the new page, so I know the variable is correct once its passed - it puts it
in the text box on the form as just "land" so then when it passes back from
the GET action of the form - it passes it back as only "land".  If I then
write Land Registry into the form text box it works fine, but as this will b
e
eventually hidden and the user has already typed the search string on the
original page - this is not an option!  Any ideas anyone please?

GwenP







[ Post a follow-up to this message ]



    Re: Asp forms and variables  
Gérard Leclercq


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-22-04 12:47 PM

Only an idea

Response.Write Replace(myvar, "%20", " ")







[ Post a follow-up to this message ]



    Re: Asp forms and variables  
Gérard Leclercq


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-22-04 12:47 PM

Instead of GET (Request.QueryString("myvar")) use POST
(Request.Form("myvar"))







[ Post a follow-up to this message ]



    Re: Asp forms and variables  
Ray Costanzo [MVP]


Report This Message To A Moderator Edit/Delete Message


 
12-22-04 10:53 PM

Make sure your input value is surrounded by quotes.  Actually, make sure all
tag attributes are.

NO:  <input type=text value=land registry>
YES: <input type="text" value="land registry" />

Ray at work

"GwenP" <GwenP@discussions.microsoft.com> wrote in message
news:2B1EDA48-243C-4F98-BFF9-9A48F82A43DD@microsoft.com...
> I am passing a variable from one asp page to another say "land registry".
It
> puts the variable in the URL (as land%20registry) as you'd expect.  I want
to
> add it to a hidden text box in a form so that I can then pass it back
> (eliminating the need to store this original search variable in a cookie).
> However even though I can response.write the variable as "land registry"
on
> the new page, so I know the variable is correct once its passed - it puts
it
> in the text box on the form as just "land" so then when it passes back
from
> the GET action of the form - it passes it back as only "land".  If I then
> write Land Registry into the form text box it works fine, but as this will
be
> eventually hidden and the user has already typed the search string on the
> original page - this is not an option!  Any ideas anyone please?
>
> GwenP
>
>







[ Post a follow-up to this message ]



    RE: Asp forms and variables  
GwenP


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-22-04 10:53 PM

Sorry - neither of these suggestions worked.  I have the variable - I can se
e
it - why can I not just populate my text box with it if it comprises more
than one word?  I have tried setting white space on and off still not
working.....?

Gwen

"GwenP" wrote:

> I am passing a variable from one asp page to another say "land registry". 
It
> puts the variable in the URL (as land%20registry) as you'd expect.  I want
 to
> add it to a hidden text box in a form so that I can then pass it back
> (eliminating the need to store this original search variable in a cookie).
> However even though I can response.write the variable as "land registry" o
n
> the new page, so I know the variable is correct once its passed - it puts 
it
> in the text box on the form as just "land" so then when it passes back fro
m
> the GET action of the form - it passes it back as only "land".  If I then
> write Land Registry into the form text box it works fine, but as this will
 be
> eventually hidden and the user has already typed the search string on the
> original page - this is not an option!  Any ideas anyone please?
>
> GwenP
>
>





[ Post a follow-up to this message ]



    Re: Asp forms and variables  
Ray Costanzo [MVP]


Report This Message To A Moderator Edit/Delete Message


 
12-22-04 10:54 PM

Who is this reply addressed to?  You replied to your own post.  Whose
suggestions?  Gérard's?  Ray's?

Ray at work

"GwenP" <GwenP@discussions.microsoft.com> wrote in message
news:94E2F396-C532-49E3-8034-3E523CF190C1@microsoft.com...
> Sorry - neither of these suggestions worked.  I have the variable - I can
see[vbcol=seagreen]
> it - why can I not just populate my text box with it if it comprises more
> than one word?  I have tried setting white space on and off still not
> working.....?
>
> Gwen
>
> "GwenP" wrote:
> 
registry". It[vbcol=seagreen] 
want to[vbcol=seagreen] 
cookie).[vbcol=seagreen] 
on[vbcol=seagreen] 
puts it[vbcol=seagreen] 
from[vbcol=seagreen] 
then[vbcol=seagreen] 
will be[vbcol=seagreen] 
the[vbcol=seagreen] 







[ Post a follow-up to this message ]



    Re: Asp forms and variables  
Bob Barrows [MVP]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
12-22-04 10:54 PM

Create a small page to reproduce the problem. Only put in the minimum html
and server-side code to allow the problem to be seen and post it here. For
example, this page:

<HTML>
<BODY>

<form method="get">
<INPUT type="text" name=text1 value="
<%=server.HTMLEncode(Request.QueryString("text1"))%>">
<INPUT type="submit" value="Submit" name=submit1>
</form>

</BODY>
</HTML>

called with this url:
http://localhost/test/pass_string_w...land%20registry

results in this output in my IE6 browser (I'm not sure you'll be able to see
the following copy-and-paste. If not, take my word that "land registry"
appears in the text box):



What does it do in your browser?

I used Server.HTMLEncode just in case the querystring contained quote
characters (or other characters that could create problems.



Bob Barrows

GwenP wrote:[vbcol=seagreen]
> Sorry - neither of these suggestions worked.  I have the variable - I
> can see it - why can I not just populate my text box with it if it
> comprises more than one word?  I have tried setting white space on
> and off still not working.....?
>
> Gwen
>
> "GwenP" wrote:
> 

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 01:11 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register