Share this Page URL

Chapter 28. Programming Form Fields > Programming Checkboxes - Pg. 475

Programming Form Fields 475 Programming Checkboxes A checkbox is a small, clickable square. Clicking the checkbox toggles a checkmark on and off within the box. When the checkmark appears, it means the setting or option represented by the checkbox is "on" or activated; when the checkmark is absent, it means the setting or option is "off" or deacti- vated. You create a checkbox by including in your form an <input> tag with the type attribute set to "checkbox": <input type="checkbox"> This creates a Checkbox object that supports the basic properties, methods, and events listed in Table 28.4. Table 28.6. Basic Properties, Methods, and Events Supported By the Checkbox Object Properties checked defaultChecked form name type value Methods click() handleEvent() Events Click MouseDown MouseUp Some of the Checkbox object's properties are a bit different than the properties of the text-related objects from the previous section, so let's examine more closely. First, here's an example Checkbox