Prototype This page is part of the Prototype JavaScript framework documentation.
Overview | (...)

Form.disable disables all elements in a form. Prototype does this by setting an element’s ‘disabled’ property to ‘true’. See Form.enable

Syntax


  Form.disable('test');

Example


  <form id="test" method="post">
  Number
  <select name="guest[size]">
       <option value="0">0</option>
       <option value="1" selected>1</option>
       <option value="2">2</option>
  </select>
  <br/>
  <label for="text">Text</label>
  <input id="form_text" name="form[text]" size="30" type="text" value="" /><br/>
  <label for="form_radio">Radio</label>
  <input id="form_radio_yes" name="form[radio]" size="30" type="radio" value="1" />yes
  <input id="form_radio_no" name="form[radio]" size="30" type="radio" value="0" />no
  <br/>
  </form>
  <p>
  <a href="#" onClick="Form.disable('test');">disable</a>
  <a href="#" onClick="Form.enable('test');">enable</a>
  </p>

Creates:

Number

yes no

disable enable