The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Update iframe?
Kewley
post Oct 10 2006, 05:46 PM
Post #1





Group: Members
Posts: 2
Joined: 10-October 06
Member No.: 397



IFRAME SRC="" width=772 height=630 name="worldframe" frameborder="0" scrolling="no">
</IFRAME>


How would I go about updating the iframe once an option has been selected from a drop down list?

For instance when the user selects an option from a drop down list, the iframe updates to show the a page. However, if the user clicks a different option the iframe updates with to show a different page?

Any help is greatly appreciate, thanks.

EDIT: I tryed using the following, but to no avail.....

CODE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>

<script type="text/javascript">
function update(page) {
document.getElementById('worldnumber').location.href=page;
}
</script>
</head>

<body>

<select id="sel" onchange="update(this.value)">
<option value="http://ams2.runescape.com/lang/en/aff/runescape/game.ws?lowmem=1&plugin=0">1</option>
<option value="http://mi6.runescape.com/lang/en/aff/runescape/game.ws?lowmem=1&plugin=0">2</option>
<option value="http://ul5.runescape.com/lang/en/aff/runescape/game.ws?lowmem=1&plugin=0">3</option>
</select>

<center>
<IFRAME
    SRC=""
    NAME="worldnumber"
    WIDTH=300 HEIGHT=200>
</IFRAME>
</center>

</body>
</html>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Oct 10 2006, 06:21 PM
Post #2


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



You use getElementById() but there is no id. Even if you add one it doesn't work. I'm afraid I don't know why. If you refer to the frame name instead it works.
window.worldnumber.location.href=page;
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 29th March 2024 - 08:37 AM