How to disable input element in prototype?

Using Prototype , it is believed that Form.Element.disable disabled the form as a whole. Is there a way to disable only one input element at a time?

And when I try this:

$$('#signup .button')[0].disbled = false; ## didn't work

Update

Sorry for everyone. It actually works. But I defined the style for the disabled in the style sheet and the style does not apply. Is there a workaround?

+5
source share
3 answers

You want to disable the method.

http://prototypejs.org/doc/latest/dom/Form/Element/disable/index.html

For example:

$(id).disable();
+23
source

Try the following:

$$('#signup .button').disable()

Or:

$(id_of_element).disable()

Or:

Form.Element.disable(id_of_element)
+5
source

This should work:

$$('#signup .button')[0].disable();
0
source

All Articles