Selection Forms

Posted by admin | Posted in HTML Tutorial | Posted on 11-08-2010-05-2008

0

The size attribute is used to break out from the single displayed drop down list. i.e. if we specify a size for the dropdown list then that many elements will be displayed on the form within the dropdown list.

Example:

  • <select size=”3″>
  • <option>California — CA</option>
  • <option>Colorado — CO</option>
  • <option>Connecticut — CN</option>
  • </select>

Selection Forms:

Selecting Multiples

We can further add to our selection forms by adding the multiple attribute. This allows the user to select more than one entry from your selection forms. Obviously this attribute does not work with the single drop down lists.

Example:

  • <select multiple=”yes” size=”3″>
  • <option>California — CA</option>
  • <option>Colorado — CO</option>
  • <option>Connecticut — CN</option>
  • </select>

Multiple Selections:

Submit Buttons

We often see that there are buttons on the webpage and when we click on the button the page is refreshed or changed and some other page is displayed.

Submit buttons are special buttons which, when clicked, activates the action part of a form.

These are generally used when some data is to be saved or fetched from the server.Basically the working of this button is related to the scripting used on the webpage.

Since we are creatting a submission button. We need to introduce a new attribute, the value attribute. Anyword(s) specified as the value will be displayed on our button. Often it is best to stick with “Submit” or “Continue”.

Example:

  • <input value=”Submit” />
  • <input value=”Continue Please!” />

Submit Buttons:

Submission buttons are a type of <input /> tag. Set the type attribute to submit. This creates a special type of button in your forms that will perfom the form’s set action. We learned about the action attribute in our HTML Forms lesson.

Notice that in the above example we also changed what was written on our button using the value attribute. This can be changed to any value you wish.

Write a comment

Twitter Users
Enter your personal information in the form or sign in with your Twitter account by clicking the button below.