Creating Check Boxes and Option Buttons

When the valid responses to a particular prompt will always be one of a few simple options, such as gender or employment status, you will get more consistent and easier-to-evaluate results by using check boxes and option buttons rather than text boxes.

For example, suppose you are asking site visitors a yes/no question such as "Are you interested in receiving our catalog by mail?" If you provide a text box, people might answer the question in any number of ways: y, n, Y, N, yes, no, Yes, No, YES, NO, maybe, Sure, No Thanks, and so on. Tabulating such results would be tedious because a human would have to evaluate each one. But if you provide a check box, there is no doubt: a check mark mean yes, and a lack ...

Get HTML and XHTML Step by Step now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.