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!

Pass Parameters in Form

Status
Not open for further replies.

lb1

Technical User
Apr 19, 2002
109
US
I do have a form where I need to pass some asp values.

The code is as follows:

form name=&quot;form1&quot; method=&quot;post&quot; action=&quot;main_2_Name.asp?Valdaty= <%= request.QueryString(Valdaty) %>

If I replace the ..request.Querystring.... by a value, the code work. If I leave the code as showned I get the following error:
Request object error 'ASP 0102 : 80004005'
Expecting string input
/product/Main.asp, line 256
The function expects a string as input.

Can I use the 'request.Querystring... ' in the code or do I need to use some hidden values.

Thanks for any help.
Louis



 
ok...

request.querystring is for if the vairable appears inside of the url

for example


to get id, you would use

request.querystring(&quot;Valdaty&quot;)

however, if your vairable does not appear in the url and comes from a previous form, then you use

request.form(&quot;Valdaty&quot;)

also if you variable is set earlier in the page for example

valdaty = 2

you would use

<% =Valdaty %>

hope that helps
 
If your script is requested with a querystring that has Valdaty in it then you could pass it along in a querystring in the page the script is generating. But you need to put quotes around the names of items in the querystring.

form name=&quot;form1&quot; method=&quot;post&quot; action=&quot;main_2_Name.asp?Valdaty= <%= request.QueryString(&quot;Valdaty&quot;) %>&quot;

 
to rac2.

How stupid I am, May be not a good day for me.
I just forgot the &quot;
Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top