Click to See Complete Forum and Search --> : Creating a popup while passing through a variable


sahra
10-11-2004, 06:36 AM
Hi having problems with my popup (script used in header displayed at end of message)

If type in

<A HREF="javascript:popup('query.asp')"</A>

- Page opens as a popup OK

<A HREF="query.asp?<%= MM_keepURL & MM_joinChar(MM_keepURL) & "SEQNO=" & rsConsultants.Fields.Item("SEQNO").Value %>"><font size="1"><%=(rsConsultants.Fields.Item("SEQNO").Value)%></font></A>

- Page opens fine in full and passes through variable needed

BUT..... when I combine the two as I want to do -

<A HREF="javascript:popup('query.asp')?<%= MM_keepURL & MM_joinChar(MM_keepURL) & "SEQNO=" & rsConsultants.Fields.Item("SEQNO").Value %>"><font size="1"><%=(rsConsultants.Fields.Item("SEQNO").Value)%></font></A>

- Page wont open , Error on page! displayed at bottom of page

Anyone help

Sahra


<!-- Javascript for popup window-->

<SCRIPT LANGUAGE="JavaScript">

<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=500,height=250,left = 362,top = 284');");
}
// End -->
</script>

Kor
10-11-2004, 07:08 AM
take care about string notation.

Try this:

<a href="javascript:void(popup('query.asp?<%= MM_keepURL & MM_joinChar(MM_keepURL) & "SEQNO=" & rsConsultants.Fields.Item("SEQNO").Value %>"><font size="1"><%=(rsConsultants.Fields.Item("SEQNO").Value)%'))">

sahra
10-11-2004, 07:31 AM
Tried but got following error


Microsoft VBScript compilation error '800a0400'

Expected statement

/old/content/gateway/mortality/mortalityICD10.asp, line 348

=(rsConsultants.Fields.Item("SEQNO").Value)%'))"></FONT></A>
^

sahra
10-12-2004, 07:06 AM
:D

Solution found from user on another forum

<%
url="query.asp?" & MM_keepURL & MM_joinChar(MM_keepURL) & "SEQNO=" & rsConsultants.Fields.Item("SEQNO").Value
%>
<A HREF="<%=url%>" target="_blank" onclick="popup('<%=url%>');return false"><font size="1"><%=(rsConsultants.Fields.Item("SEQNO").Value)%></font></A>


<SCRIPT LANGUAGE="JavaScript">
function popUp(URL) {
day = new Date();
id = day.getTime();
window["page" + id]=window.open(URL,id,'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=500,h eight=250,left = 362,top = 284');
}
</script>