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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hide the frame on page load

Status
Not open for further replies.

dvknn

IS-IT--Management
Mar 11, 2003
94
0
0
US
Hi,

I have a HTML page which contains a 'table' and I have a 'Add' button which then creates a 'Frame' under the table.

I would like to 'hide' the frame upon loading the form. Click 'Add', the frame would be visible and when I click another button, I would like the frame to 'hide' again.

How can I do that?
 
<iframe src="somePage.htm" style="display:none;" id="myFrame"></iframe>

<input type=button value="show" onClick="document.getElementById('myFrame').style.display='inline'">

<input type=button value="hide" onClick="document.getElementById('myFrame').style.display='none'">

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

zen.gif
 
I do not have any 'iframes'. Based on the code below, Is it OK to use them if I did not use them while defining my FRAMESET?


Here's the code that I have

Form.html

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"[URL unfurl="true"]http://www.w3.org/TR/html4/loose.dtd">[/URL]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<SCRIPT src="javascript_tree/mktree.js" LANGUAGE="JavaScript"></SCRIPT> 
<script language="javascript1.1">
function displayAddForm()
{
	parent.frames["footer"].location = "AddForm.html";	
}
</script>
<LINK REL="stylesheet" HREF="javascript_tree/mktree.css"> 
<LINK REL="stylesheet" HREF="css/GTA_Online.css">
<title>GTA Online Prototype </title>
</head>
<body>
<form>
<table id="Main"> 
	<tr id="FirstMainRow">
		<td>
			<!--<A href="#" onClick="expandTree('tree1'); return false;">Expand All</A>&nbsp;&nbsp;&nbsp-->
			<!--<img src="javascript_tree/plus.gif" onClick="expandTree('tree1'); ">
			<input type="button" onClick="expandTree('tree1'); return false;" value="View/Edit">-->
			Country&nbsp;&nbsp;&nbsp;<select name="cboCountrySelector" class="ReferenceData_form_stylesheet">
			<option value="ALL" selected>ALL
			<option value="UNITED STATES OF AMERICA" >UNITED STATES OF AMERICA
			<option value="UNITED KINGDOM" >UNITED KINGDOM
			<option value="UNITED ARAB EMIRATES" >UNITED ARAB EMIRATES
			<option value="PHILLIPINES" >PHILLIPINES
			<option value="ANTIGUA AND BARBUDA">ANTIGUA AND BARBUDA
			<option value="BOSNIA-HERZEGOVINA" >BOSNIA-HERZEGOVINA
			</option>
			</select>
			<br><br>
		</td>
	</tr>
	<tr id="SecondMainRow">
		<td>
			<table>
				<tr>
					<td>
						<input type="button" name="btnAdd" value="Add"  onClick="displayAddForm()" class="ButtonStyle" >&nbsp;&nbsp;&nbsp;
					</td>
					<td>
						<input type="button" name="btnEdit" value="Edit"  onClick="displayFooter()" class="ButtonStyle" >&nbsp;&nbsp;&nbsp;
					</td>

					<td>
						<input type="button" name="btnDelete" value="Delete" class="ButtonStyle" >&nbsp;&nbsp;&nbsp;
					</td>
					<td>
						<input type="button" name="btnSaveExit" value="Save/Exit" class="ButtonStyle" >&nbsp;&nbsp;&nbsp;
					</td>
					<td>
				      	<input type="button" name="btnCancel" value="Cancel" class="ButtonStyle" >&nbsp;&nbsp;&nbsp;	
				   	</td>
				</tr>
	 	  	</table>
		</td>
	</tr>
	<tr><td>&nbsp;</td></tr>
	<tr id="ThirdMainRow">
		<td>
			<ul class="mktree" id="tree1">
				<!--<li class="liOpen">calendars-->
				<li class="liOpen">View
					<ul>
						<table>
							<tr>
								<td>
									<table cellspacing="1" cellpadding="0" width="100%"  border="1">
										<tr>
											<th nowrap=true>FormID</th>
											<th>IE</th>
											<th>DocumentName</th>
											<th>Agency</th>
											<th>OfficialForm</th>
											<th>Description</th>
											<th>Sample</th>
											<th nowrap=true>PDF FileName</th>
											<th>Available Online</th>								
											<th nowrap=true>LinkID</th>
										</tr>
										<tr>
											<td nowrap=true>WWF005</td>
											<td>2</td>
											<td>Pro-Forma Invoice</td>
											<td>NA</td>
											<td>NA</td>
											<td>blah blah blah blah
											</td>
											<td>N</td>
											<td>WWF005</td>
											<td>N</td>
											<td>&nbsp;</td>
										</tr>
										<tr>
											<td nowrap=true>WWF006</td>
											<td>2</td>
											<td>Shipper's Declaration for Dangerous Goods</td>
											<td>NA</td>
											<td>NA</td>
											<td>blah blah blah blah
											</td>
											<td>N</td>
											<td>WWF007</td>
											<td>N</td>
											<td>&nbsp;</td>
										</tr>
										<tr>
											<td nowrap=true>WWF007</td>
											<td>1</td>
											<td>Biological Materials Worksheet</td>
											<td>NA</td>
											<td>NA</td>
											<td>blah blah blah blah											</td>
											<td>N</td>
											<td>WWF007</td>
											<td>N</td>
											<td>&nbsp;</td>
										</tr>
								</table>
							</td>
						</tr>
					</table>
				</ul>
			</li>
		</ul>
	</td>
</tr>
</table>
</form>
</body>
</html>

AddForm.html:

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
	<HEAD>
		<TITLE> New Document </TITLE>
		<META NAME="Generator" CONTENT="EditPlus">
		<META NAME="Author" CONTENT="">
		<META NAME="Keywords" CONTENT="">
		<META NAME="Description" CONTENT="">
	</HEAD>
	
	<BODY>
		<form>
		<table>
			<tr>
				<td>
					<table>
						<tr>
							<td>FormID &nbsp;&nbsp;<input type="text" name="txtFormID">&nbsp;&nbsp;&nbsp;&nbsp;</td>
							<td>IE&nbsp;&nbsp;<select name="cboIE"></select>&nbsp;&nbsp;&nbsp;&nbsp;</td>
							<td>FormID &nbsp;&nbsp;<input type="text" name="txtFormID"></td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
		</form>
	</BODY>
</HTML>

Form_frameset.html:

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"[URL unfurl="true"]http://www.w3.org/TR/html4/loose.dtd">[/URL]
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
		<title>Untitled Document</title>
			<frameset  cols="*" rows="80%,*" frameborder="0">
				<frame marginwidth="0" marginheight="0" src="Form.html" name="heading" >
				<frame src="UntitledFrame-1" name="footer" scrolling="auto" frameborder="0">
			</frameset>
		</frameset><noframes></noframes>
	</head>
</html>

The application will run in IE browser.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top