ChrisQuick
Programmer
I have a function set as the OnClick event for a button.
The code for the function is:
A new window will open and display the form. The user can then check or uncheck boxes and then press the "Refresh Layers" button to submit the form back to the parent.
This works fine in IE, but in NetScape, the window simply closes. Can anyone tell me what I am doing wrong?
chrisquick@aol.com
Geographic Information System (GIS), ASP, some Oracle
The code for the function is:
Code:
<script type="text/javascript" language="JavaScript 1.2">
function showNewLegendWindow() {
ccMapLegend=window.open('','msg','toolbar=yes,location=yes,menubar=yes,height=300,width=200,resizable=yes,scrollbars=yes,left=0,top=0')
ccMapLegend.document.write("<html><head><title>Legend</title>")
ccMapLegend.document.write("</head><body>")
ccMapLegend.document.write("<form OnSubmit=\"self.close()\">")
ccMapLegend.document.write("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 COLS=1><tr><td align='center'>")
ccMapLegend.document.write("<INPUT TYPE=submit STYLE=\"{background-color: blue; color: white}\" VALUE='Refresh Layers' OnClick=\"this.form.target=opener.name\"></td></tr>")
ccMapLegend.document.write("<input type=hidden name=name value='columbia'>")
ccMapLegend.document.write("<input type=hidden name=cmd value='refresh'>")
ccMapLegend.document.write(" <INPUT TYPE='hidden' NAME='Left' Value=572139.071912><INPUT TYPE='hidden' NAME='Bottom' Value=1220284.87947><INPUT TYPE='hidden' NAME='Right' Value=698089.798366><INPUT TYPE='hidden' NAME='Top' Value=1346088.755075> ")
ccMapLegend.document.write("<tr><td align='left'><INPUT TYPE=CHECKBOX NAME='Tax_Parcels' Checked><Font face='arial' size='1'>Tax Parcels</font></input></td></tr>")
ccMapLegend.document.write("<tr><td align='left'><INPUT TYPE=CHECKBOX NAME='Buildings'><Font face='arial' size='1'>Buildings</font></input></td></tr>")
ccMapLegend.document.write("<tr><td align='left'><INPUT TYPE=CHECKBOX NAME='FEMA_Firm'><Font face='arial' size='1'>FEMA Firm</font></input></td></tr>")
ccMapLegend.document.write("<tr><td align='left'><INPUT TYPE=CHECKBOX NAME='Police_Beats'><Font face='arial' size='1'>Police Beats</font></input></td></tr>")
ccMapLegend.document.write("<tr><td align='left'><INPUT TYPE=CHECKBOX NAME='Wetlands'><Font face='arial' size='1'>Wetlands</font></input></td></tr>")
ccMapLegend.document.write("<tr><td align='left'><INPUT TYPE=CHECKBOX NAME='Lakes'><Font face='arial' size='1'>Lakes</font></input></td></tr>")
ccMapLegend.document.write("<tr><td align='left'><INPUT TYPE=CHECKBOX NAME='Streams'><Font face='arial' size='1'>Streams</font></input></td></tr>")
ccMapLegend.document.write("<tr><td align='left'><INPUT TYPE=CHECKBOX NAME='Zoning'><Font face='arial' size='1'>Zoning</font></input></td></tr>")
ccMapLegend.document.write("<tr><td align='left'><INPUT TYPE=CHECKBOX NAME='Fire_Districts'><Font face='arial' size='1'>Fire Districts</font></input></td></tr>")
ccMapLegend.document.write("<tr><td align='left'><INPUT TYPE=CHECKBOX NAME='Drainage_Basins'><Font face='arial' size='1'>Drainage Basins</font></input></td></tr>")
ccMapLegend.document.write("<tr><td align='left'><INPUT TYPE=CHECKBOX NAME='Primary_Roads' Checked><Font face='arial' size='1'>Primary Roads</font></input></td></tr>")
ccMapLegend.document.write("<tr><td align='left'><INPUT TYPE=CHECKBOX NAME='City_Limits' Checked><Font face='arial' size='1'>City Limits</font></input></td></tr>")
ccMapLegend.document.write("<tr><td align='left'><INPUT TYPE=CHECKBOX NAME='County_Boundary' Checked><Font face='arial' size='1'>County Boundary</font></input></td></tr>")
ccMapLegend.document.write("</table></form></body></html>")
}
</script>
A new window will open and display the form. The user can then check or uncheck boxes and then press the "Refresh Layers" button to submit the form back to the parent.
This works fine in IE, but in NetScape, the window simply closes. Can anyone tell me what I am doing wrong?
chrisquick@aol.com
Geographic Information System (GIS), ASP, some Oracle