How to disable an input element in Prototype?
19,458
Solution 1
You want the disable method.
http://prototypejs.org/doc/latest/dom/Form/Element/disable/index.html
For example:
$(id).disable();
Solution 2
Try this:
$$('#signup .button').disable()
Or:
$(id_of_element).disable()
Or:
Form.Element.disable(id_of_element)
Author by
freenight
Updated on June 14, 2022Comments
-
freenight about 2 years
Using Prototype, the Form.Element.disable is said to be disabled the form as a whole. Is there any way to disable only one single input element at a time?
And when I try this:
$$('#signup .button')[0].disbled = false; ## didn't work
Updated
Sorry for all. Actually it works. But I have defined a disabled style in a stylesheet and the style doesn't got applied. Is there any workaround?