You could do:

Element.addMethods('button', {
  enable: Field.enable,
  disable: Field.disable
})

At first, I thought it's a bug, but now I see that "button" elements
don't quite work as regular form controls - i.e. button's "value" is
updated by modifying its contents (rather than changing its value
attribute).

Is this the reason why we don't extend buttons with Form.Element
methods?

- kangax

On May 7, 5:45 am, Pablo Impallari <[EMAIL PROTECTED]> wrote:
> Disble and enable dont work on button tags.
>
> Using input type buttons, works ok.
> <form action="" method="get">
>   <input type="button" id="test1" value="Hi world" />
> </form>
> <a href="#" onclick="$('test1').disable();">disable</a>
>
> But using button tags dont work.
> <form action="" method="get">
>   <button id="test2">Hi world</button>
> </form>
> <a href="#" onclick="$('test2').disable();">disable</a>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to