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

variables passed from page to page

Status
Not open for further replies.

rtnMichael

Programmer
Aug 5, 2002
152
US
Hey, I have a variable passed into another page through a form. The next page grabs it with a request.form, and that seems to work fine. But when I want to use it in a Javascript function, it doesn't recognize it as being set. How do I cross a variable from VBScript to Javascript?

Here's what I have:

set mylocation = Request.form("mylocation")

<script language=&quot;JavaScript&quot;>

if(mylocation == &quot;home&quot;)
{
team = new Array(
new Array(
new Array(&quot;window&quot;,&quot;window&quot;),
new Array(&quot;door&quot;,&quot;door&quot;),
new Array(&quot;floor&quot;,&quot;floor&quot;)
)
);
}

else if(mylocation == &quot;outside&quot;)
{
team = new Array(
new Array(
new Array(&quot;grass&quot;,&quot;grass&quot;),
new Array(&quot;rocks&quot;,&quot;rocks&quot;)
)
);
}

apperently the &quot;set&quot; is VBScript, and the rest is Javascript. It tells me that &quot;mylocation&quot; is undefined...what can I do?

Thanks
Mike
 
<script language=&quot;JavaScript&quot;>

mylocation = &quot;<%=Request.form(&quot;mylocation&quot;)%>&quot;

..
..
..

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

fart.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top