This sample from the second link looks kind of like what I need:
function fireClickEvent(control)
{
if (document.all)
{
control.fireEvent("onclick
}
else
{
var clickEvent = window.document.createEven
clickEvent.initEvent("clic
control.dispatchEvent(clic
}
}
but I don't know how to convert it for use with onChange which is not a "MouseEvent"
I have done this:
<script language="javascript" type="text/javascript" for="window" event="onload">
if (document.all) { initialize(); }
else { window.document.addEventLi
</script>
<script language="JavaScript">
function fireChangeEvent(control)
{
if (document.all)
{
control.fireEvent("onchang
}
else
{
var changeEvent = window.document.createEven
changeEvent.initEvent("cha
control.dispatchEvent(chan
}
}
</script>
but it throws errors, any thoughts?
Main Topics
Browse All Topics





by: b0lsc0ttPosted on 2007-10-17 at 10:52:03ID: 20095506
SBennett,
uk/tutoria ls/javascr ipt/domeve nts
ersonal/aa nttila/Blo g/Lists/Po sts/ Post.a spx?ID=6
The fireEvent method is only for IE. There are alternatives. I don't have one that I wrote myself but take a look at these.
http://www.howtocreate.co.
OR
http://blogs.vertigo.com/p
Let me know how those will work. I'll be happy to help more if you need or have a question. They both look good (scroll down a bit on each page to find the "manually fire event" or "firing events" section). Let me know if you have any questions or need more information.
b0lsc0tt