Christophe Porteneuve wrote:
> Hey there,
>
> [EMAIL PROTECTED] a écrit :
> > thanks everyone, i got it working under Firefox. however, it doesn't do
> > anything in IE ( i am testing it under 6.0) . i am using Sonny's
> > example.
> >
> >> <script type="text/javascript">
> >> new Form.Element.EventObserver( 'id1',function(ele,value){
> >> $('id2').innerHTML="test";  } );
> >> </script>
>
> Well, first, onChange is not always triggered at the same time,
> depending on the browser.  Some of those require that the component
> loses focus.  Try that.

tried lose the focus, nothing.
by the way, the prototype site mentioned that it support IE 6 above, i
guess it is not really the case ?

> Also, consider switching from ".innerHTML = x" to ".update(x)", which is
> more portable.

thanks, applied.

> Finally, if this doesn't cut it still, consider moving to a regular
> Observer, which is time-based, with, say, a half-second period.  This
> will be slightly more resource-hungry, but ensures a value change is
> detected quickly enough.

doesn't work either.. here is what i have.

<html>
<head>
<script type="text/javascript" src="prototype.js"></script>
</head>
<body>

<form>
<select id="id1">
  <option>A</option>
   <option>B</option>
</select>
</form>
<div id="id2""></div>

<script type="text/javascript">
   new Form.Element.Observer( 'id1', 0.5, getHTML );
    function getHTML(ele, val)
    {
         Element.update("id2",val);
    }
</script>
</body>
</html>

> --
> Christophe Porteneuve a.k.a. TDD
> "[They] did not know it was impossible, so they did it." --Mark Twain
> Email: [EMAIL PROTECTED]

J.


--~--~---------~--~----~------------~-------~--~----~
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