Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable an input element in Prototype?

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?

like image 830
freenight Avatar asked Dec 31 '09 15:12

freenight


1 Answers

You want the disable method.

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

For example:

$(id).disable();
like image 90
twernt Avatar answered Oct 20 '22 07:10

twernt