Web Design Tutorials
|
||||||||||||||||||
Again, you'll have to change around the dimensions to suit your needs. cols and rows here mean COLumns and, ROWS respectively. Take note that this tag needs an end-tag too. Any text you put in there between the tags will appear in the box when the form is loaded. Selection BoxesThese three elements give the reader a choice of options, and asks them to pick out one or more of them. 1. Radio ButtonsThese small circular buttons can be used in polls or information forms to ask the user their preference. When you set up a group of them, you can only select one choice. Try it here: They're called radio buttons because they function like the buttons on a really old car radio. Remember, the guys who came up with this stuff have beards as long as your arm, so you're should expect things like that. The code for a radio button is:
The code is about the same as the one you've seen before. type="radio" says
that this is going to be a radio button. There is a new attribute
here too — value. This is like the answer to a question.
Say you were asking the reader what they liked most about your
site. The name of this group of questions would be 'likemost' and
there would be three choices, all radio buttons, all with name="likemost" in
them, to show that they're all part of the same question. Then
the three values could be 'layout', 'content' and 'graphics'.
When you receive the results, you'll get something like: likemost=layout 2. Check BoxesGroups of check boxes are similar to radio buttons except multiple boxes from the same group can be selected at the same time. They are small squares that are marked with a tick when selected. Here's a few to play with: The code for these boxes is the same as for the radio buttons, with just the value of the type attribute changed:
3. Drop-down Select BoxesThese are a cool way to get a user to select an option. They perform the same thing as radio buttons, it's just the way they look that's different. Most of the options available are not in view until the user gets intimate with the box and clicks on it. The rest of the options will then pop-up below the box. The lengthy code is:
select boxes are like textareas — they have their own
tag, but these elements hold further tags inside them too.
Each choice you give your reader is denoted by an option. The
name/value system remains from the tags above. The size attribute
sets how many lines of options are displayed. Setting this
to anything over 1 (the default) is really defeating the purpose
of having the options hidden away. Send and Reset ButtonsNow that you've gotten the reader to fill in all the information you want, you need a finishing button to click on to send it all to your e-mail address (or wherever you've said at the start). You can also clear all the info in the form out with the reset button. They're both real easy to make, and look like this: The simple tags for these two are:
The value attribute in this case sets the text that's displayed on the front of the button. When you click submit all the form information is sent to your target and the page (or following page) is loaded.
|
||||||||||||||||||