[html-formfu] Checkbox attributes

Carl Franks fireartist at gmail.com
Fri Oct 26 20:20:39 GMT 2007


On 26/10/2007, kewei xiao <kewei.xiao at nald.ca> wrote:
> Hi Carl
>
>      Is there any way I can call a javascript function when a checkbox
> is checked.  In my app, I have a group of checkbox reside in scrollable
> box, when one of the checkbox is checked, a javascript function will be
> called and display a proper box below.  But I don't wanna the box to be
> shown when the checkbox is unchecked.  I have tried to use
>
>      attributes_xml => { onclick => "calledFunction()" } OR
> attributes_xml => { onchange => "calledFunction()" },  none of them work
> as I expect.
>
> Hopefully you can give me some hints.  Thanks

Ke Wei,

This works in firefox:

    attributes_xml:
      onclick: "if (this.checked == true) { calledFunction() };"

Carl



More information about the HTML-FormFu mailing list