Disabling Form Elements

In some cases, you may not want visitors to use certain parts of your form. For example, you might want to disable a submit button until all the required fields have been filled out Image.

Image Here, I use JavaScript and the disabled attribute to make the Other text area inaccessible until the Other radio button is selected.

<li>     <input type="radio" name="how" value="facebook" id="facebook" onclick="document.getElementById('other_description').disabled = true;" />     <label for="facebook">Facebook</label></li><li>     <input ...

Get HTML5 and CSS3: Visual QuickStart Guide, Seventh Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.