Back to Top
The nuts and bolts for
Creative web development

Enable/Disable Form Objects

This behavior sets the availability of form objects (= controls) in a selected form, and it allows you to:

  • enable selected controls;
  • disable selected controls;
  • toggle the availability of selected controls (if the control was enabled it becomes disabled, and vice versa).

When filling out forms, there are sometimes form elements that need not (or even should not) be filled/activated depending on other values or choices in the form.
This extension allows you to disable form elements, so that the user can't activate them or enter text in them.

Overview

An example might be that the Submit button is disabled until the user makes a selection indicating that he/she agrees to the Terms and Conditions.
In this example the behavior would be applied twice to the page:

  1. to the onLoad event of the BODY tag to initially disable the Submit button (choose 'disable'),
  2. to the onClick event of the checkbox to toggle the availability of the Submit button (choose 'toggle').

Questions? Read the FAQ first!

UI Access

Access this behavior:
step 1 - make sure there is a (named) form with at least one form object in the current document, and
step 2 - choose 'Enable/Disable Form Objects' from the 'FlevOOware' flyout in the Behaviors palette.

Features

Online Demo: External link


Requirements

Type: Behavior
Product: Dreamweaver 4, Dreamweaver MX, UltraDev 4, Dreamweaver 4.01, Dreamweaver MX 2004, Dreamweaver 7
Browser: IE 5, IE 5.5, IE 6, Netscape 6, Mozilla 1.0, Opera 6


Marja Ribbers-de Vroed

Marja Ribbers-de VroedWell, what's there to tell?

I worked as a software engineer for a well-known Dutch software company for about 10 years. But then I decided I did not want to work there anymore.
Since then, I've been working with my husband in our own company.

I "discovered" web development early 2000, and I soon found out that I could actually create my own extra (DHTML) features in Dreamweaver by building custom extensions.
My first extension was Cross-browser AutoScroller, but I've developed several other ones since then.

See All Postings From Marja Ribbers-de Vroed >>

Share this Article

Reviews

An extension?

DW reports a new installed extension, but I can't find anything new on the screen, anywhere. And no help is available. And the tool seemed to be so promising!

how to get a single form element to toggle >1 other element?

i can easily get the behaviour working when a single form element (checkbox) toggles a single other form element.

 

however, it seems to only allow one at a time.  even in the UI, i can only have one form element set to toggle at any one time.

 

i have tried to append additional form.id strings to the end of what the behaviour writes to the onClick, but only the 1st form element in the string will toggle.

 

Any help?
seannarae
 

great extension

this has proved to be a great extension for me. I needed to check that a user supplies a file name (via File Field) before submitting. As I'm using ASP this is the only way that I can disable the file upload until they enter a file.

A tutorial for this extension would really help

A tutorial for this extension would really help out. It took me a while to figure which was best for what scenario (enable, disable, toggle).

Something even small would help starters.