Forum Moderators: open

Message Too Old, No Replies

Iframe Help + Javascript Help

         

asp_guru

4:27 pm on Jul 5, 2004 (gmt 0)

10+ Year Member



How can i reference a combo box (list box) located in an iframe using javscript. I need to be able to hide them if the mouse is rolled over something in the main document.

I'm going out of my mind!

Regards
Cameron

Rambo Tribble

10:54 pm on Jul 5, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



For you to be able to manipulate the contents of an iframe, the page in the iframe must be from the same domain as the main page.

Try the following two files:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>test_93a_FraHid.htm</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<style type="text/css">
html,body{height:100%;width:100%;}
body{background:#EED;}
</style>
<script type="text/javascript">
function hideDiv(){
var a=window.fraOne.document.getElementById("d1");
a.style.visibility="hidden";
}
</script>
</head>
<body onclick="hideDiv();">
<div id="divOne"></div>
<iframe name="fraOne" src="test_93b_FraHid.htm"></iframe>
</body>
</html>

And:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>test_93b_FraHid.htm</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<style type="text/css">
body{background:#DEE;}
</style>
</head>
<body>
<div id="d1">
<form name="frmOne" action="" onclick="tranFrm();">
<input name="inOne" value="test value " />
</form>
</div>
</body>
</html>

asp_guru

9:00 am on Jul 6, 2004 (gmt 0)

10+ Year Member



Thank You! :-)

That sorted it.

Thanks again