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

Session variable

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi,
I have a button and this code in my asp page (the OrderId is passed from another page):

<%
Session(&quot;vordId&quot;)= Orderid
%>

<SCRIPT LANGUAGE=vbscript>
Sub ConfirmIt_OnClick()
Dim Resp
Resp = window.confirm (&quot; & orderId & &quot;)
End Sub
</SCRIPT>

<input type=&quot;submit&quot; name=&quot;ConfirmIt&quot; value=&quot;Accept&quot;></input>

When I click on the button, the message only displays this:
& orderId & instead of the value. Can you please help?

Thanks.
 
change the line
Resp = window.confirm (&quot; & orderId & &quot;)
to
Resp = window.confirm (<%=Orderid%>)

source of error:
when you surround any value by the doublequotes, vbscript treats the value surrounded by as a string value itself.
in order to interact with the variable orderid, you must remove the doublequotes.
 
Can I do this Resp = window.confirm(<%Session(&quot;vorderid&quot;)%>?
 
Yes, but you forgot a few characters.

Try this..


window.confirm(&quot;<%=Session(&quot;vorderid&quot;)%>&quot;)


ToddWW
 
ToddWW is right.
You need to have a better idea of the differences between your programming mode-ASP or client side VBS. I think you probably should read more books/tutorials on Server/Client.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top