Dreamweaver - Forms - Adding a check box
Go to the forms tab on the Insert menu:
Click on the icon to create a new form. In Design view, the form is outlined by a dashed red line.
Once you've created a form, move your cursor inside the form area. Then click on the icon to create a new check box. Check boxes are used to collect answers to yes/no questions, or to select a number of items from a small list:
Here's the code for that example:
If you want to change the properties of the check box, right click on it and select what you want to edit.
Selecting "Name..." pops up a window that allows you to change the name of the check box.
Selecting "Value..." pops up a window that allows you to change the value of the check box. This has nothing to do with the check box being checked or unchecked. The Value of a checkbox is used like the Value of a hidden element.
Selecting "Edit Tag <input>..." allows you to change all of the attributes at once:
- The "Type" dropdown menu lets you change it from a check box to a radio button or any other kind of form element.
- The "Name" textfield lets you change the name of the check box.
- The "Value" textfield lets you change the value of the check box.
- The "Checked" check box lets you specify is the checkbox is checked or unchecked by default.
- The "Disabled" check box greys out the check box and does not allow the user to click on it.
Select "Edit Tag Code <input>..." if you want to edit the tag properties by hand.
Alternatively, you can change the properties of the check box through the properties menu:
- The box under the word "CheckBox" on the left is the name of the check box.
- The "Checked Value" field is the value of the check box.
- The "Initial State" radio buttons let you select whether the check box is checked or unchecked by default.