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!

passing parameter to popup window 2

Status
Not open for further replies.

arkadia93

Programmer
Oct 19, 2006
110
GB
I am trying to pass a parameter to a popup window, but without any success. Here is my code :

Dim CompanyName
CompanyName = rsLog("Name")
if ((rsLog("BrandDescription") = "PCWB") or _
(rsLog("BrandDescription") = "Equanet Education")) then
Response.Write "<td bgcolor=FFFFFF><font size=2><A HREF=""javascript:popUp('companyequanet.asp', CompanyName)"">" & rsLog("Name")& sitename & "</A></td>"
end if

And the Javascript :

function popUp(URL, CompanyName)
{
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL + "?company=" + CompanyName, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=180,height=30,left = 412,top = 284');");
}

In the status bar, I just get the string 'CompanyName' instead of the value that is assigned to CompanyName. Can somebody help?
 
Code:
Dim CompanyName
                    CompanyName = rsLog("Name")
                    if ((rsLog("BrandDescription") = "PCWB") or _
                        (rsLog("BrandDescription") = "Equanet Education")) then
                        Response.Write "<td bgcolor=FFFFFF><font size=2><A HREF=""javascript:popUp('companyequanet.asp', [COLOR=red][b]'" & CompanyName & "''[/b][/color])"">" & rsLog("Name")& sitename & "</A></td>"
end if

A smile is worth a thousand kind words. So smile, it's easy! :)
 

oops - ignore the 3rd red '

A smile is worth a thousand kind words. So smile, it's easy! :)
 
Code:
Dim CompanyName
                    CompanyName = rsLog("Name")
                    if ((rsLog("BrandDescription") = "PCWB") or _
                        (rsLog("BrandDescription") = "Equanet Education")) then
                        Response.Write "<td bgcolor=FFFFFF><font size=2><A HREF=""javascript:popUp('companyequanet.asp', [COLOR=red][b]'" & CompanyName & "'[/b][/color])"">" & rsLog("Name")& sitename & "</A></td>"
end if

A smile is worth a thousand kind words. So smile, it's easy! :)
 
Thanks Damber, I just figured that out myself....but now I want to use the value of the CompanyName variable on the popup page that I am opening. How do I get hold of this value? Here is my popup code, I want to provide a link on the popup using the CompanyName variable as a parameter :

<td align="center">
<a href="company.asp?company=<%CompanyName%>&orderby=activitydate">Company details</a>
</td>
 
<a href="company.asp?company=<%[red]=[/red]CompanyName%>&orderby=activitydate">Company details</a>

-DNG
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top