5

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?

3
  • I guess it should either be disAbled = true, or enabled = false...
    – Zed
    Dec 31, 2009 at 15:46
  • Regarding the disabled style, are you applying/toggling a disabled class on the form element?
    – twernt
    Dec 31, 2009 at 16:02
  • No class necessary. All browsers support: input[disabled] { .. } jsFiddle
    – Rudie
    May 1, 2011 at 2:19

3 Answers 3

23

You want the disable method.

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

For example:

$(id).disable();
1
5

Try this:

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

Or:

$(id_of_element).disable()

Or:

Form.Element.disable(id_of_element)
0

This should work:

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.