hi,
what if there are already functions that handle the event (either by
<select onchange="functionname">) or the equivalent
....elements["elementname"].onchange? how can i make sure that it's my
function that runs and not the others?
Randy Webb wrote:[color=blue]
>
zzzbla@gmail.com said the following on 4/24/2006 1:21 PM:[color=green]
> > Hi,
> >
> > I need to attach a javascript function I wrote to the onChange event of
> > a <select> tag. However, I'm using a 3rd party tool that creates the
> > html files - it only lets me add bits of html to it, I can't touch the
> > elements it produces, so I can't just add an onChange="myfunction"
> > attribute to that <select> tag. I can't change the onload attribute of
> > the <body> tag.
> >
> > How can I run code that attached my function to that event?[/color]
>
> Does your select have a name or id attribute?
>
> If so, simply add an onchange event to it:
>
> document.forms['formID'].elements['selectName'].onchange=functionToExecuteOnChange;
>
> --
> Randy
> comp.lang.javascript FAQ -
http://jibbering.com/faq & newsgroup weekly
> Javascript Best Practices -
http://www.JavascriptToolbox.com/bestpractices/[/color]