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

javascript function, cookies and vbscript variables

Status
Not open for further replies.

wbodger

Programmer
Apr 23, 2007
769
US
OK, I have a problem I am trying to solve without much luck. I have a page when a user can choose their contact info which will then take them to another selection page. I want to add that contact id to their existing cookie, but I have the contact id in a vbscript variable. My thought was to do an onclick event on the a href, but that means I have to pass the contact id in the function call, correct? But the value I need to pass is in a vbscript variable thru ado. So, is there a way I can use the vbscript variable in javascript, or is there another way to accomplish my goal?

I was thinking
Code:
<a href="ministry.asp?conid=<%=conid %>" onclick="addcontactid(conid)">

where conid is dimmed and a value assigned to it earlier

Code:
<% dim conid : conid = rs("contact_id")%>

What I am trying to accomplish is assigning the chosen contact id to their existing cookie BEFORE they reach ministry.asp because there are two ways to get to ministry.asp and the other method places the contact id in their cookie dictionary before they get there.

So, anybody got any great ideas on solving this dilemma?

wb
 
What is wrong with this?
[tt] <a href="ministry.asp?conid=<%=conid %>" onclick="addcontactid([red]'<% =conid %>'[/red])">[/tt]
 
To be honest, I thought it wouldn't work so didn't actually try it. Guess I will go ahead and try it and let you know!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top