...

View Full Version : onChange Event not working in Firefox



SoulGlo
02-05-2007, 06:21 PM
Hey All. I've been trying for a few days to create an embedded media player with drop down menu that changes which video is being played in the player. Code works fine in IE, but no luck in FF. Any suggestions would be greatly appreciated.

<OBJECT ID="MediaPlayer" width=608 height=511 classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/ mplayer/en/nsmp2inf.cab#Version=5,1,52,701" standby= "Loading Media Player" type="application/x-oleobject">
<PARAM NAME="FileName" VALUE="intro.wmv">
<PARAM NAME="AutoStart" Value="True">
<PARAM NAME="ShowControls" VALUE="True">
<PARAM NAME="ShowStatusBar" VALUE="True">
<PARAM NAME="Loop" VALUE="True">

<EMBED type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" SRC="intro.wmv" width=608 height=511 name="MediaPlayer" autostart="1" ShowStatusBar=1 ShowControls=1 >
</EMBED></OBJECT>


<body>
<body><body><body>

<body>
</p>
<FORM name="MediaForm">
<p align="center"><font size="5">
<SELECT NAME="VidChange" onChange="{document.MediaPlayer.FileName = document.MediaForm.VidChange.options[document.MediaForm.VidChange.selectedIndex].value}">
<OPTION VALUE="intro.wmv">Select a WiFiLynx Movie
<OPTION VALUE="sunshine.wmv">Little Miss Sunshine
<OPTION VALUE="smoking.wmv">Thank You For Smoking
<OPTION VALUE="underground.wmv">Underground Archive
<OPTION VALUE="iceage.wmv">Ice Age
</SELECT></font></p>

nikkiH
02-05-2007, 08:49 PM
Firefox is a lot pickier about valid html. That's really, really invalid. You've got multiple body elements, incorrectly nested tags, missing end tags...

Try fixing that first, and then change to getElementById instead of that shortcut syntax where you can't tell if it's using the ID or the name of the element.

SoulGlo
02-05-2007, 09:19 PM
Thanks for your response NikkiH...does this look better?

<!-- begin embedded WindowsMedia file... --><br>
<br>
<table border='0' cellpadding='0' align="center">
<tr>
<td><object id="MediaPlayer" width="608" height="511" classid=
"CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase=
"http://activex.microsoft.com/activex/controls/%20mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
standby="Loading Media Player" type=
"application/x-oleobject"><param name="FileName" value="intro.wmv">
<param name="AutoStart" value="True">
<param name="ShowControls" value="True">
<param name="ShowStatusBar" value="True">

<param name="Loop" value="True">
<embed type="application/x-mplayer2" pluginspage=
"http://www.microsoft.com/Windows/MediaPlayer/" src="intro.wmv"
width="608" height="511" name="MediaPlayer" autostart="1"
showstatusbar="1" showcontrols="1"></object><br>
<br>
<form name="MediaForm">
<p align="center"><font size="5"><select name="VidChange" onchange=
"{document.MediaPlayer.FileName = document.MediaForm.VidChange.options[document.MediaForm.VidChange.selectedIndex].value}">
<option value="intro.wmv">Select a WiFiLynx Movie</option>
<option value="sunshine.wmv">Little Miss Sunshine</option>
<option value="smoking.wmv">Thank You For Smoking</option>
<option value="underground.wmv">Underground Archive</option>
<option value="iceage.wmv">Ice Age</option>
</select></font></p>
</form>

</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>


**I am very new to all of this and have come across getElementbyId but I am not sure where to put it in**

_Aerospace_Eng_
02-05-2007, 09:41 PM
Go to the Multimedia forum and read the sticky titled "Embedded Windows Media Player". I mean read the whole thing, your answer is there. Trust me I remember giving the code numerous times.

nikkiH
02-05-2007, 10:00 PM
That html looks MUCH better. :)

And here's the link to the other post.
http://codingforums.com/showthread.php?t=50666

SoulGlo
02-05-2007, 11:49 PM
Much Thanks you two....I stumbled upon said thread a few day back, but did not realize it was 41 pages long.

I'm tweaking right now, but have already got the getElementById working properly.


I'm sure I'll be finding more as I keep making it through that thread...it's only my 3rd day of messing around with code and its starting to sink in, but I really do appreciate your knowledge and patience



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum