ExpertRating - Online Certification and Employment Testing ExpertRating - Online Certification and Employment Testing ExpertRating - Online Certification and Employment Testing

ExpertRating Home
ExpertRating Benefits
Recommend ExpertRating
Suggest More Tests
Privacy Policy
FAQ
Login
 
XHTML Tutorial - Index
XHTML Tutorial - Introduction to XHTML
XHTML Tutorial - Formatting
XHTML Tutorial - Links
XHTML Tutorial - Images
XHTML Tutorial - Forms
XHTML Tutorial - Tables
XHTML Tutorial - Frames
XHTML Tutorial - Style Sheets
XHTML Tutorial - Advanced Tags
     

 
Online Personal Trainer Certification
Personal Trainer Certification (Spanish)
Six Sigma Certification
Find a Personal Trainer
Project Management Certification
Six Sigma Certification
Six Sigma Black Belt Certification
Master Black Belt Certification
Six Sigma Green Belt Certification
Life Coach Certification
Lean Management Certification
Lean Six Sigma Certification
First Aid Certification
CPR Certification
Yoga Certification
Aerobics Certification
Pilates Certification
Business Analyst Certification
SEO Certification
Online Business Writing Course & Certification
Makeup Artist Certification
Baby Sitting Course & Certification
Time Management Certification
Health Club Management Certification
Medical Coding Certification
Medical Billing Certification
Business Analysis Course
Master Trainer Certification
Total Quality Management Certification
Kaizen Certification
Creative Writing Certification
Event Management Certification
Test Search by Job Title
Administrative Assistant Certification
Virtual Assistant Certification
  All Online Courses
   

   
   
   
   
   
   

   
  Home > Courses, Tutorials & eBooks > XHTML Tutorial > Forms
 
Previous  Next

XHTML Tutorial - Forms

   
                                                                             Page 3 of 5
 

Option Tag

The option tag is used with the <select> tag (the select tag will be discussed immediately after this) to create select lists. It indicates the start of a new option in the list. It is used with the value attribute which indicates what is sent to the server. The text that follows the option tag is the text that is displayed in the browser. In HTML the <option> tag need not be closed but it has to be done in XHTML. This is the only difference between the option tag of HTML and option tag of XHTML.

Attribute of Option Tag

Value

It indicates the value that is sent to the server when that option is selected. The user does not see the value of value attribute in the browser.

Example

<select name=”jokenumber”>

<option value=”001”> Cricket jokes </option>

<option value=”002”> Golf jokes </option>

<option value=”003”> Tennis jokes </option>

</select>

 

Select Tag

The select tag creates a list of options, one or more of which can be selected. In its simplest form, it has a <select> tag, one or more <option> tags and a </select> tag. It is exactly similar to the <select> tag of HTML.

Example

<select name=”jokenumber”>

<option value=”001”> Cricket jokes </option>

<option value=”002”> Golf jokes </option>

<option value=”003”> Tennis jokes </option>

</select>

 
 

Attributes of Select Tag

Name

This names the select field for use with the server. It works similarly as it works with the input tag.

Example

<select name=”jokenumber”>

 

</select>

 

Size

Size indicates how many rows of the list should be displayed. It means the number of items that are shown in the drop down list. The default size is one.

Example

<select name=”jokenumber” size=4 >

 

</select>

 

Multiple

Multiple indicates that more than one option from the list can be selected. It is useful to apply the size attribute while creating multiple lists.

Example:

 

<select name=”jokenumber” multiple size=4>

 

</select>

 

Optgroup Tag

The Optgroup tag defines an option group. Various choices can be grouped under this tag. When there is a long list of options, groups of related choices are easier to handle. These groups are user friendly and timesaving. This tag is the same as used in HTML.

Attribute of Optgroup

Label

It defines a label for the option field.

Example

<select name=”jokenumber”>

<optgroup label=”Game jokes”>

<option value=”001”> Cricket jokes </option>

<option value=”002”> Golf jokes </option>

</optgroup>

 

<optgroup label=”Other jokes”>

<option value=”111”> Classic jokes </option>

<option value=”112”> Short jokes </option>

</optgroup>

</select>

 
     

 

 
     
Home  |  About Us  |  Privacy Policy  |  Site Map  |  FAQs  |  Contact Us
 
© ExpertRating 2015. All Rights Reserved.