M
mike
I have a page that uses a some javascript and it works fine in IE but
fails to work in Firefox. Basically what I'm trying to do is have 3
iframes on a page but only displaying one of them at a time. A button
is displayed for the two iframes that are not displayed and when the
button is clicked, the corresponding iframe is shown and the other two
are closed and buttons for the closed iframes are then displayed.
Firefox says basically two things. 1) the div name i'm specifying is
not defined. I tried changing my reference from
emsframe.style='block' to document.emsframe.style='block' and this did
seem to fix that problem but then I get an error saying that the
object has no properties which is referring to the line: <div
id='emsframe' style='display: none'> as well as all the other lines
that define the iframes divisions.
I'm sure it's probably something simple that I'm missing but I don't
see it. any help would be greatly appreciated.
<html>
<head>
<style type="text/css">
input.mysearchterm{font-size: 10pt;font-weight: bold}
input.mybuttons{font-size: 10pt;font-weight: bold}
input.mycancelbuttons{font-size: 10pt;font-weight: bold;color: red}
input.myfindbutton{font-size: 10pt;font-weight: bold}
input.myheaderbutton{font-size: 10pt;font-weight: bold;width:
100%;text-align: right}
select.mysearchtype{font-size: 10pt;font-weight: bold}
</style>
<script language='JavaScript'>
var OpenWindow;
function setMyFocus()
{
document.myform.searchterm.focus();
document.myform.searchterm.select();
}
function openNewAtm()
{
openTmFrame();
mySearchHeader.style.display='none';
myMaintenanceHeader.style.display='block';
document.myform.editmode.value="ADD";
document.myform.target='subframe';
document.myform.action='newatm.asp';
document.myform.submit();
}
function openEmsFrame()
{
tmframe.style.display='none';
tmHeader.style.display='block';
emsframe.style.display='block';
emsHeader.style.display='none';
techframe.style.display='none';
techHeader.style.display='block';
setMyFocus();
}
function openTechFrame()
{
tmframe.style.display='none';
tmHeader.style.display='block';
emsframe.style.display='none';
emsHeader.style.display='block';
techframe.style.display='block';
techHeader.style.display='none';
setMyFocus();
}
function openTmFrame()
{
tmframe.style.display='block';
tmHeader.style.display='none';
emsframe.style.display='none';
emsHeader.style.display='block';
techframe.style.display='none';
techHeader.style.display='block';
setMyFocus();
}
function openEditAtm(theATMID)
{
//mySearchHeader.style.display='none';
//myMaintenanceHeader.style.display='block';
//document.myform.editmode.value='EDIT';
//document.myform.theid.value=theATMID;
//document.myform.target='subframe';
//document.myform.action='editatm.asp';
//document.myform.submit();
}
function openReports()
{
openTmFrame();
mySearchHeader.style.display='none';
myMaintenanceHeader.style.display='block';
document.myform.action='reports.asp';
document.myform.target='subframe';
document.myform.submit();
}
function getResults()
{
if (tmframe.style.display == 'none')
{
openTmFrame();
}
document.myform.action='search.asp';
document.myform.target='subframe';
setMyFocus();
document.myform.submit();
}
function refreshPage()
{
document.myform.action='index.asp';
document.myform.target='';
document.myform.submit();
}
function saveNewAtm()
{
document.myform.target='subframe'
document.myform.submit()
}
</script>
</head>
<body bgcolor='BOC4DE' onLoad='setMyFocus()'>
<form name='myform' method='post' onSubmit='setMyFocus()'
action='search.asp' target='subframe'>
<input name='editmode' type='hidden'>
<input name='theid' type='hidden'>
<div id='myMaintenanceHeader' style='display: none'>
<table border='1' width='750'>
<tr>
<td align='center'><br>
<input type='button' class='mycancelbuttons' value='Cancel and
Return to Search' onClick="refreshPage()">
<br><br></td>
</tr>
</table>
</div>
<div id='mySearchHeader' style='block'>
<table border='1' width='750'>
<tr>
<td>
<table width='100%'>
<tr>
<td align='left'>
<input type='button' value=' Reports ' onClick="openReports()"
class='mybuttons'>
</td>
<td>
<center><font=+2><b>Search By: </b></font>
<select name='searchtype' size='1' class='mysearchtype'
onChange='setMyFocus()'>
<option>ATMID
<option>RC Number
<option>Node Number
<option>Address
<option>Phone Number
</select></center>
</td>
<td align='right'>
<input type='button' value='New ATM' onClick="openNewAtm()"
class='mybuttons'>
</td>
</tr>
<tr>
<td colspan='3' align='center'>
<hr size='2' color='000000'>
<font=+2><b>Enter the Search Term and click
Find: </b></font>
<input type='text' name='searchterm' size='25' maxlength='20'
class='mysearchterm'>
<input type='button' name='findbutton' value=' FIND '
onClick='getResults()' class='myfindbutton'>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div id='tmHeader' style='display: none'>
<table width='750'>
<tr>
<td align='right'>
<input type='button' name='showTM' value='TESTMASTER '
onClick="openTmFrame()" class='myheaderbutton'>
</td>
</tr>
</table>
</div>
<div id='tmframe' style='display: block'>
<IFRAME src='search.asp' name='subframe' width='750' height='435'
scrolling='auto' frameborder='1'>
</IFRAME>
</div>
<div id='emsHeader' style='display: block'>
<table width='750'>
<tr>
<td align='right'>
<input type='button' name='showEms' value='E M S '
onClick="openEmsFrame()" class='myheaderbutton'>
</td>
</tr>
</table>
</div>
<div id='emsframe' style='display: none'>
<IFRAME src='ems.asp' name='subframe2' width='750' height='435'
scrolling='auto' frameborder='1'>
</IFRAME>
</div>
<div id='techHeader' style='display: block'>
<table width='750'>
<tr>
<td align='right'>
<input type='button' name='showTechs' value='TECHS '
onClick="openTechFrame()" class='myheaderbutton'>
</td>
</tr>
</table>
</div>
<div id='techframe' style='display: none'>
<IFRAME src='techs.asp' name='subframe3' width='750' height='435'
scrolling='auto' frameborder='1'>
</IFRAME>
</div>
</form>
</body>
</html>
fails to work in Firefox. Basically what I'm trying to do is have 3
iframes on a page but only displaying one of them at a time. A button
is displayed for the two iframes that are not displayed and when the
button is clicked, the corresponding iframe is shown and the other two
are closed and buttons for the closed iframes are then displayed.
Firefox says basically two things. 1) the div name i'm specifying is
not defined. I tried changing my reference from
emsframe.style='block' to document.emsframe.style='block' and this did
seem to fix that problem but then I get an error saying that the
object has no properties which is referring to the line: <div
id='emsframe' style='display: none'> as well as all the other lines
that define the iframes divisions.
I'm sure it's probably something simple that I'm missing but I don't
see it. any help would be greatly appreciated.
<html>
<head>
<style type="text/css">
input.mysearchterm{font-size: 10pt;font-weight: bold}
input.mybuttons{font-size: 10pt;font-weight: bold}
input.mycancelbuttons{font-size: 10pt;font-weight: bold;color: red}
input.myfindbutton{font-size: 10pt;font-weight: bold}
input.myheaderbutton{font-size: 10pt;font-weight: bold;width:
100%;text-align: right}
select.mysearchtype{font-size: 10pt;font-weight: bold}
</style>
<script language='JavaScript'>
var OpenWindow;
function setMyFocus()
{
document.myform.searchterm.focus();
document.myform.searchterm.select();
}
function openNewAtm()
{
openTmFrame();
mySearchHeader.style.display='none';
myMaintenanceHeader.style.display='block';
document.myform.editmode.value="ADD";
document.myform.target='subframe';
document.myform.action='newatm.asp';
document.myform.submit();
}
function openEmsFrame()
{
tmframe.style.display='none';
tmHeader.style.display='block';
emsframe.style.display='block';
emsHeader.style.display='none';
techframe.style.display='none';
techHeader.style.display='block';
setMyFocus();
}
function openTechFrame()
{
tmframe.style.display='none';
tmHeader.style.display='block';
emsframe.style.display='none';
emsHeader.style.display='block';
techframe.style.display='block';
techHeader.style.display='none';
setMyFocus();
}
function openTmFrame()
{
tmframe.style.display='block';
tmHeader.style.display='none';
emsframe.style.display='none';
emsHeader.style.display='block';
techframe.style.display='none';
techHeader.style.display='block';
setMyFocus();
}
function openEditAtm(theATMID)
{
//mySearchHeader.style.display='none';
//myMaintenanceHeader.style.display='block';
//document.myform.editmode.value='EDIT';
//document.myform.theid.value=theATMID;
//document.myform.target='subframe';
//document.myform.action='editatm.asp';
//document.myform.submit();
}
function openReports()
{
openTmFrame();
mySearchHeader.style.display='none';
myMaintenanceHeader.style.display='block';
document.myform.action='reports.asp';
document.myform.target='subframe';
document.myform.submit();
}
function getResults()
{
if (tmframe.style.display == 'none')
{
openTmFrame();
}
document.myform.action='search.asp';
document.myform.target='subframe';
setMyFocus();
document.myform.submit();
}
function refreshPage()
{
document.myform.action='index.asp';
document.myform.target='';
document.myform.submit();
}
function saveNewAtm()
{
document.myform.target='subframe'
document.myform.submit()
}
</script>
</head>
<body bgcolor='BOC4DE' onLoad='setMyFocus()'>
<form name='myform' method='post' onSubmit='setMyFocus()'
action='search.asp' target='subframe'>
<input name='editmode' type='hidden'>
<input name='theid' type='hidden'>
<div id='myMaintenanceHeader' style='display: none'>
<table border='1' width='750'>
<tr>
<td align='center'><br>
<input type='button' class='mycancelbuttons' value='Cancel and
Return to Search' onClick="refreshPage()">
<br><br></td>
</tr>
</table>
</div>
<div id='mySearchHeader' style='block'>
<table border='1' width='750'>
<tr>
<td>
<table width='100%'>
<tr>
<td align='left'>
<input type='button' value=' Reports ' onClick="openReports()"
class='mybuttons'>
</td>
<td>
<center><font=+2><b>Search By: </b></font>
<select name='searchtype' size='1' class='mysearchtype'
onChange='setMyFocus()'>
<option>ATMID
<option>RC Number
<option>Node Number
<option>Address
<option>Phone Number
</select></center>
</td>
<td align='right'>
<input type='button' value='New ATM' onClick="openNewAtm()"
class='mybuttons'>
</td>
</tr>
<tr>
<td colspan='3' align='center'>
<hr size='2' color='000000'>
<font=+2><b>Enter the Search Term and click
Find: </b></font>
<input type='text' name='searchterm' size='25' maxlength='20'
class='mysearchterm'>
<input type='button' name='findbutton' value=' FIND '
onClick='getResults()' class='myfindbutton'>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div id='tmHeader' style='display: none'>
<table width='750'>
<tr>
<td align='right'>
<input type='button' name='showTM' value='TESTMASTER '
onClick="openTmFrame()" class='myheaderbutton'>
</td>
</tr>
</table>
</div>
<div id='tmframe' style='display: block'>
<IFRAME src='search.asp' name='subframe' width='750' height='435'
scrolling='auto' frameborder='1'>
</IFRAME>
</div>
<div id='emsHeader' style='display: block'>
<table width='750'>
<tr>
<td align='right'>
<input type='button' name='showEms' value='E M S '
onClick="openEmsFrame()" class='myheaderbutton'>
</td>
</tr>
</table>
</div>
<div id='emsframe' style='display: none'>
<IFRAME src='ems.asp' name='subframe2' width='750' height='435'
scrolling='auto' frameborder='1'>
</IFRAME>
</div>
<div id='techHeader' style='display: block'>
<table width='750'>
<tr>
<td align='right'>
<input type='button' name='showTechs' value='TECHS '
onClick="openTechFrame()" class='myheaderbutton'>
</td>
</tr>
</table>
</div>
<div id='techframe' style='display: none'>
<IFRAME src='techs.asp' name='subframe3' width='750' height='435'
scrolling='auto' frameborder='1'>
</IFRAME>
</div>
</form>
</body>
</html>