Elements such as text boxes and check boxes cry out for alignment. CSS for the form with layout and access features Note that we use the User-Defined System Colors in the style rules, so that our form inherits the user's system settings. Another key aspect of HTML forms is the ability to validate the user's data with client-side script before we actually send the data to the server for processing. In our sample, we check only for missing data. For the first two, we just check the value of each to ensure it is not blank.
Radio buttons are a bit more work.
The NAME attribute is used to group radio buttons, so that only one may be checked at a time. It also exposes all radio buttons of the same name as a collection. We set an initial flag to false and loop through the collection looking for a checked button, which will cause us to set our flag to true. One use of this is if we find that the user's data is not valid, and we want to return him to the element that caused validation to fail. If when the alert message box is closed the cursor is placed in that Password element, then the user just has to type without having to get to that specific element.