[html-formfu] event.observe handling

Carl Franks fireartist at gmail.com
Thu Aug 2 16:07:42 GMT 2007


On 13/07/07, kewei xiao <kewei.xiao at nald.ca> wrote:
> I am not sure How I can handle event.observe in yml file, something like
> this:
>
> Event.observe( window, 'load',
>         function () {
>             Event.observe( 'country', 'click',  function () {
> countryChosen('country'); } );
>             Event.observe( 'country', 'keypress',  function () {
> countryChosen('country'); } );
>             countryChosen( 'country' );
>
> Can I use "attributes_xml: { onchange: countryChosen(this.id) }" to
> handle the event.observe?

Did you get this solved?

You might have to enclose the value in quotes:
    attributes_xml: { onchange: 'countryChosen(this.id)' }

Carl



More information about the HTML-FormFu mailing list