Help with a paramaterized popup (Full Version)

All Forums >> [Web Development] >> Microsoft FrontPage Help



Message


jeffmetcalf -> Help with a paramaterized popup (5/18/2007 12:30:47)

This piece of code runs fine:

<a href="#" onClick="MyWindow=window.open('partslabor.asp','MyWindow','toolbar=no,location=yes,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=450,height=300'); return false;">Labor and Materials</a>
<i><font color="#CC0000" size="1">(popups must be allowed for this site)</font></i>


This little piece of code does not:

<a href="#" onClick="MyWindow=window.open('partslabor.asp?CALLNBR=<%=FP_FieldURL(fp_rs,"CALLNBR")%>','MyWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=450,height=300'); return false;">Labor and Materials</a>
<i><font color="#CC0000" size="1">(popups must be allowed for this site)</font></i>


That gets
Microsoft VBScript runtime error '800a000d'

Type mismatch: 'rs'

/mycplus/_fpclass/fpdblib.inc, line 48

Or is there a way to change the default way this will open:
<a target="_blank" href="partslabor.asp?CALLNBR=<%=FP_FieldURL(fp_rs,"CALLNBR")%>">

Thanks in advance.




BeTheBall -> RE: Help with a paramaterized popup (5/18/2007 13:42:58)

I would put the opening a new window portion in a separate function in the head of the document, ie:

<script type="text/javascript">
function popIt(url,winName) {
ref = window.open(url,winName,"'toolbar=no,location=yes,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=450,height=300")
ref.focus();
}
</script>

Then this:

<a target="_blank" href="partslabor.asp?CALLNBR=<%=FP_FieldURL(fp_rs,"CALLNBR")%>">

becomes this:

<a target="whatever" href="partslabor.asp?CALLNBR=<%=FP_FieldURL(fp_rs,"CALLNBR")%>" onclick="popIt(this,'newWin');return false;">

See if that works for you.




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.0625