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!

ASP variables in a Javascript popup window

Status
Not open for further replies.

KingElvis

Programmer
Jan 28, 2004
39
0
0
IL
I have a popup window that currently works for a specific 'surname' entry.

<a href="javascript:popup('send_email.asp?surname=<%=rsUsers("surname")%>',360,400,'no')">Send EMail</a>


My problem is how to write the same code using a surname AND first name. I seem to be having problems with the syntax. I tried

<a href="javascript:popup('send_email.asp?surname=<%=rsUsers("surname")%> AND first=<%-rsUsers("First")%>',360,400,'no')">Send EMail</a>

but it doesnt work!
 
try assembling the url before you write the <a href> tag.
then just reference the one variable. It's much easier to troubleshoot the variable assembly outside of the tag.
e.g.
Code:
<%
dim varUrl
varUrl = "send_email.asp?surname=" & rsUsers("surname") & "&first=" & rsUsers("First")
%>
<a href="javascript:popup('<%=varUrl%>',360,400,'no')">Send EMail</a>
 
You need an ampersand, not 'and'between 'surname' and 'first'.

<a href="javascript:popup('send_email.asp?surname=<%=rsUsers("surname")%>&first=<%-rsUsers("First")%>',360,400,'no')">Send EMail</a>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top