2009/4/3 ColinFine <colin.f...@pace.com>

>
>
>
> On Apr 3, 4:27 am, "Miguel Beltran R." <yourpa...@gmail.com> wrote:
> > Hi list
> >
>
> >
> > I want three thing
> > 1: have a window with a table filled with many options and descriptions:
>  OK
> > 2: fill hide1 field when field1 value has enter manually: OK
> > 3: fill hide1 field when field1 value has change using code js: FAIL
> >
> Unfortunately, the events (onclick etc) are all specified in the HTML
> specification to react to user-land only, not to changes from script.
>
> I can see three possibilities for you:
> 1. Make your code that sets the field also call the handler itself.
> (Probably a bad idea, but workable)
> 2. Set a timed observer, as Maarten suggests. (Seems an awfully big
> cost)
> 3. I have never tried it, but I would think that you could define a
> Prototype custom event [1], fire it from your setting code and observe
> for it as well as for click.
>
> [1] http://www.prototypejs.org/api/element/fire
>
> Colin
>

Thanks Maaten and Colin

I had already thought about the solutions 1 and 2, but I dislike
The third solution does not understand.
I did this but it does not work:

using fire:
document.observe('sic:proyecto',function(evt){
   console.log("entro a sic proyecto");
});

$('proyecto').observe('change',function(evt{
   Element.fire('sic:proyecto');
});

I tried to test enter data manually but the function not call the fire, so
less with the function

Firebug shows that the error is:
element is null
element.dispatchEvent(event)
line 4071

I use 1.6.0.3
-- 
________________________________________
Lo bueno de vivir un dia mas
es saber que nos queda un dia menos de vida

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to