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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JS var to ASP var

Status
Not open for further replies.

jstar7

Programmer
Dec 17, 2002
61
GB
Ok first off, I have read the other thread which is similar to this wuestion but I still don't get it.

I have a JS var as a string and I want to post this to the next ASP page as an ASP variable.

Any help on this would be gratefully appreciated, thanks for your time.
 
page1.asp

<script>
function jsClick(inVar){
document.location = &quot;Page2.asp?jsVar=&quot; + inVar
}
</script>
<input type=button value=&quot;Apple&quot; onClick=&quot;jsClick('apple')&quot;>
<input type=button value=&quot;Orange&quot; onClick=&quot;jsClick('orange')&quot;>




page2.asp

<%
fruitSelected = request.querystring(&quot;jsVar&quot;)

%>
-----------------------------------------------------------------
&quot;Whether you think that you can, or that you can't, you are usually right.&quot;
- Henry Ford (1863-1947)

mikewolf@tst-us.com
 
Cheers mate, thats what I was looking for.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top