Almost :)

To quote Martin, "Execution of JS code happens as the HTMl file is  
parsed. The time this
code is executed, there is no "id2" element in the DOM."

You have to put the <script> block containing the EventObserver call  
_after_ you define
the select element. Just move the <script> block right after the </ 
form> closing tag or so.

-Thomas


Am 23.10.2006 um 23:42 schrieb [EMAIL PROTECTED]:

>
> thanks for the reply. however, this doesn't work either.. seems to be
> loading forever. probably some dumb mistake i made but i just can't  
> see
> it now.. :-(
>
> <html>
> <head>
> <script type="text/javascript" src="prototype.js"></script>
> </head>
> <body>
>
> <script type="text/javascript">
> new Form.Element.EventObserver( 'id1',function(ele,value){
> $('id2').innerHTML="test";  } );
> </script>
>
> <form>
> <select id="id1">
>    <option value="">A</option>
>     <option>B</option>
> </select>
> </form>
> <div id="id2""></div>
>
> </body>
> </html>
>
>
> >

--
Thomas Fuchs
wollzelle

http://www.wollzelle.com

questentier on AIM
madrobby on irc.freenode.net

http://www.fluxiom.com :: online digital asset management
http://script.aculo.us :: Web 2.0 JavaScript
http://mir.aculo.us :: Where no web developer has gone before





--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs
-~----------~----~----~----~------~----~------~--~---

Reply via email to