StivenUSB
03-20-2007, 01:21 AM
I am trying to have a form for sports, if you choose nba, it takes you to a certain iframe... if you choose nhl in the form, it takes you to another address in an iframe... It works and does exactly what I want but in the status bar it shows an error and I am not sure why.. I would really appreciate some guidance with this as I am not very js savvy :(... If someone has a suggestion for a better way of doing this I welcome your assistance as well. Code is included below with form as well:
<tr id="Sports_table">
<td align="center" bgcolor="#000066" class="$getbgrow"> <form name="jumpy" action="post" style="margin: 0px; padding: 0px;">
<select onchange="gone();" size="1" name="example">
<option value="http://www.sportsline.com/nba/box-scoreboards">NBA</option>
<option value="http://www.sportsline.com/nfl/box-scoreboards">NFL</option>
<option value="http://www.sportsline.com/nhl/box-scoreboards">NHL</option>
<option value="http://www.sportsline.com/mlb/box-scoreboards">MLB</option>
<option value="http://www.sportsline.com/collegefootball/box-scoreboards">NCAA
Football</option>
<option value="http://www.sportsline.com/collegebasketball/box-scoreboards" selected="selected">NCAA
Basketball</option>
</select>
</form>
<font size="1" color="#999999">Courtesy CBS Sportsline</font><br>
<script type="text/javascript" language="JavaScript">
var displaymode=0;
<!-- This adds the iframe -->
var iframecode="<iframe id='external' style='width: 259px; height: 300px;' src='http://www.sportsline.com/collegebasketball/box-scoreboards' scrolling='auto' border='1' marginwidth='2' marginheight='2' align='center' frameborder='0'></iframe>";
if (displaymode==0) {
document.write(iframecode);
}
function gone() {
var selectedurl=document.jumpy.example.options[document.jumpy.example.selectedIndex].value;
if (document.getElementById&&displaymode==0) {
document.getElementById("external").src=selectedurl;
} else if (document.all&&displaymode==0) {
document.all.external.src=selectedurl;
} else {
if (!window.win2||win2.closed) {
win2=window.open(selectedurl);
} else {
win2.location=selectedurl;
win2.focus();
}
}
}
</script> </td>
</tr>
</table>
<tr id="Sports_table">
<td align="center" bgcolor="#000066" class="$getbgrow"> <form name="jumpy" action="post" style="margin: 0px; padding: 0px;">
<select onchange="gone();" size="1" name="example">
<option value="http://www.sportsline.com/nba/box-scoreboards">NBA</option>
<option value="http://www.sportsline.com/nfl/box-scoreboards">NFL</option>
<option value="http://www.sportsline.com/nhl/box-scoreboards">NHL</option>
<option value="http://www.sportsline.com/mlb/box-scoreboards">MLB</option>
<option value="http://www.sportsline.com/collegefootball/box-scoreboards">NCAA
Football</option>
<option value="http://www.sportsline.com/collegebasketball/box-scoreboards" selected="selected">NCAA
Basketball</option>
</select>
</form>
<font size="1" color="#999999">Courtesy CBS Sportsline</font><br>
<script type="text/javascript" language="JavaScript">
var displaymode=0;
<!-- This adds the iframe -->
var iframecode="<iframe id='external' style='width: 259px; height: 300px;' src='http://www.sportsline.com/collegebasketball/box-scoreboards' scrolling='auto' border='1' marginwidth='2' marginheight='2' align='center' frameborder='0'></iframe>";
if (displaymode==0) {
document.write(iframecode);
}
function gone() {
var selectedurl=document.jumpy.example.options[document.jumpy.example.selectedIndex].value;
if (document.getElementById&&displaymode==0) {
document.getElementById("external").src=selectedurl;
} else if (document.all&&displaymode==0) {
document.all.external.src=selectedurl;
} else {
if (!window.win2||win2.closed) {
win2=window.open(selectedurl);
} else {
win2.location=selectedurl;
win2.focus();
}
}
}
</script> </td>
</tr>
</table>