6.5. An Example FormFigure 6-1 presents an HTML form showing as many form features as we can fit in the example. ![]() Figure 6-1. The completed formThe HTML used to create this form is shown here:
First, we use an <input> text field to get the user's bank account number. For the user's Personal Identification Number (PIN), we use an <input> password field so that the numbers don't appear on screen. (In real life, this wouldn't be considered sufficient for protecting someone's PIN, since the data entered is sent unencrypted across the Internet.) Next, we use a selection box to have the user choose a transaction. The user can choose to get account balances, transfer money, see a listing of the most recent transactions on that account, or stop payment on a check. We use a radio box to let the user choose whether to get a written verification of this transaction. The default is to send written verification. In a radio box, the user can choose exactly one of the options. Notice that with radio boxes, each item needs to have the same name but different value attributes. Next, we use a series of checkboxes to find out what additional information a user might want us to send. For any loose ends, we use a <textarea> box to allow the user a chance to blow off steam. Finally, we provide submit and reset buttons. When the user submits this query, the browser sends a request to the server similar to the following:
Copyright © 2003 O'Reilly & Associates. All rights reserved. |
|