|
|
Last month I started with the "FORMS" tutorial. I was originally planning for this to be a two part series but it looks now like it might extend to 3, possibly even 4 articles. This is a quite complicated section of html and I think it is best to take it slowly.
I'm afraid this months article will have to be kept pretty short. I've got huge exams starting on the 7th and I had to tear myself away from books for an hour to write this. I will introduce some more aspects of the forms, without getting too complicated. So just sit back, relax, and take it easy - afterwards you should practice with these new tags and be prepared for next months article. The exams will be finished by then so it will be much more extensive. OK, last moth I introduced you to text fields, <textarea> & input fields, <input type=text>, <input type=password>. This month I will start will selection lists. Selection lists can appear in a list or a drop down menu, as shown in the image (taken from my html tutorial @ http://www.usheen.com/html/) In the drop down list you simply click on the arrow and the other options appear. This type of input is ideal when you want to give your visitor a number of options to select from, instead of just letting them type an answer. You use the <select> tag. Don't forget that you must specify a name for every part of your html form: <select name="sel1">. The list will by default appear as a drop down menu but if you want it to appear as a scrolling list you use the size attribute: <select name="sel1" size=3>: This will create a scrolling list with enough room to display three options. You set the options using the <option> tag. You must use one <option> tag for each option you want to specify. Each <option> tag MUST have a "value" attribute set. <option value="opt1">. There is a very simple reason for this. Imagine you want someone's name. You simply supply an input field for them to type their name into. The name they type is returned to you as the value of that part of the form. (Don't worry about HOW it is returned to you yet). Well with a selection list, the visitor selects a particular option in the list and the value that is specified with the "value" attribute is returned to you. Maybe that's not so simple - read the paragraph again if you feel like it! Go To Page: 1 2
The copyright of the article Forms - part 2 in HTML Lessons is owned by . Permission to republish Forms - part 2 in print or online must be granted by the author in writing.
|
|
|
|
|
|
|
|