XHTML form example
Below is a simple form with checkboxes, please fill it in.
Explanations:
- In the head, some JavaScript code that defines a "give_feedback" function is loaded
- Checkboxes are a bit more difficult to handle than radio
buttons. Also, unlike radio buttons you can either choose to
differentiate between check boxes by either giving same name but different value
combination or alternatively by giving each checkbox its own name.
-
To decide if a user checked a checkbox, you need to look the the "checked" property.
In the first case you have to retrieve the element by an index, in the second you don't need to.
- JavaScript code is inside this page ...
Made by Daniel K. Schneider, TECFA. This is freeware.
Last modified: Mon Mar 31 19:22:02 CEST 2008