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

Onclick - Session Variable 1

Status
Not open for further replies.

teblack

Programmer
Apr 30, 2004
45
0
0
I have a asp page that has a "DELETE" button on it. I currently have a confirm message box showing via the onclick using javascript. What I would like to do is have the onclick check a session variable, and then based on that variable use one of two confirm messages i.e.(see example below). I have attempted this a couple of times but have not had any luck, so I wanted to make sure that it could even be done.

Code:
onclick="javascript: if session("xyz") confirm("message 1") else confirm("message 2")
[\code]

Any help with this would be greatly appreciated.

Thanks

TBlack -
 
Session variables are stored server side, so you will have to reference them as though they are server side:

Using ASP:
Code:
onclick="javascript: if ([COLOR=red][b]<%=[/b][/color]session("xyz")[COLOR=red][b]%>[/b][/color]) confirm("message 1") else confirm("message 2")

-kaht

...looks like you don't have a job, so why don't you get out there and feed Tina.
headbang.gif
[rockband]
headbang.gif
 
Kaht, thanks I will give it a try. Thanks again for the response.

Thanks -

TBlack -
 
Wow, this is an old thread. Glad the search function finally helped someone [lol]

-kaht

[small] <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <.</B>[/small]
[banghead] [small](He's back)[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top