Categories:

Enabling/ disabling form elements using JavaScript

In Windows, elements can be in the "disabled" state until the appropriate time or selection has been made. Here is an example using a typical "find console", seen in many Windows applications:

findscreen.gif (5083 bytes)
Screen shot of a typical "find" console in Windows

Notice the "Find Next" button on the right side of the console appears grayed out and unclickable. That's what called a "disabled" button. As soon as you type something into the "Find What" box, this button will immediately be enabled. If you're currently using Windows (and who doesn't?), you should be familiar with this useful interface feature that makes operating Windows much more user friendly.

Well, that feature just hit the web as well. Starting in IE 4+ and NS6+/ Firefox, you can apply the disable/enable feature to your form elements, creating user-friendly and "self-guiding" forms for your surfers. How? through the disabled attribute of HTML, and some JavaScript, that's how!