Web Design Stuff
HTML Tutorials    CSS Tutorials    Web Hosting   Resources
Create a Web Page 101
Making Web Pages Intro What is a Web Page? Why Make a Web Page? The History of HTML Learn HTML or XHTML?
Basic HTML
Basic HTML Tutorials Basic HTML Necessities How to Make a Web Page How to Edit a Web Page The Basics of HTML Tags Basic HTML Page Structure HTML Attributes
HTML Font Codes
HTML Font Codes Intro HTML Font Color Codes HTML Font Size Codes HTML Font Style Codes HTML Bold/Italic Codes Combining Font Codes
Formatting Text
Formatting Text Intro Making Paragraphs Miscellaneous Formatting Headings & Subheadings Creating Hyperlinks
Using Graphics
Using Graphics on the Web Add Graphics to Your Pages Graphics and Accessibility How to Align Graphics Page Color & Background Graphics as Hyperlinks Horizontal Rules
Creating Tables
HTML Tables Tutorials HTML Table Fundamentals Background & Border Color Table Frames & Rules Table Width and Alignment Cells 1 -Space & Alignment Cells 2 -Row Column Span Cells 3 -Width & Height
Making Lists
HTML Lists Tutorials Bulleted Lists Numbered Lists Definition Lists
HTML Frames
HTML Frames Tutorials Using Frames for Layout Advanced Frame Layouts Putting Hyperlinks in Frames Frame Border Width Color, Margin and Control Problems with Frames SmartFrames: A Solution SSI: An Alternative to Frames
Web Page Forms
Making Feedback Forms A Simple Feedback Form Installing NMS FormMail Debugging Your Setup My Web Host is Out to Lunch User Input Components Text Fields Checkboxes & Radio Buttons Dropdown Menus Push Buttons Layout and Presentation
Basic CSS
Basic CSS Tutorials What is CSS? Why You Should Use CSS How to Use CSS Inline Styles Embedded Style Sheets External Style Sheets Class Selectors ID Selectors Combining Selectors
CSS Properties
CSS Properties Intro Font Styles Width, Height & Spacing Borders Backgrounds Position Float & Alignment Hyperlinks
All About Web Hosting
Hosting Your Own Website What is a Web Host? Your Website's Home Page Building a Website Offline About Free Web Hosting Best Free Web Hosting Commercial Web Hosting How to Get a Domain Name Ecommerce Web Hosting Web Hosting Terminology
Free Web Design Tools
Best Free Website Tools Best Free Text Editors Best Free Graphics Editors Free Website Analysis Tools
Setting Up HTML Kit
HTML Kit Introduction How to install HTML Kit Screenshot Breakdown Basic Configuration Overall Appearance Shortcuts and Startup Editing Window Customizing Toolbars Using the Favorites Tab Making a New Actions Bar Odds and Ends
Free Templates
Free Website Templates Two Column Fixed Width Three Column Liquid Layout Miscellaneous Templates Dynamic Menu Effects Two Column Experimental Terms of Use About These Templates
Website Templates Help
Getting Started Template Zip File Download How to Edit Your Template What to Edit in the HTML How to Add Your Logo Making a Website
Web Design Tips
Web Design Basics Tables vs. Tableless Using Tables for Layout Example Table Layouts World's Crappiest Web Page
Twitter Backgrounds
Twitter Backgrounds Intro Cool Twitter Backgrounds Cool Twitter Backgrounds 2 Plain Twitter Backgrounds Dark Twitter Backgrounds Best Twitter Backgrounds Cute Twitter Backgrounds Music Twitter Backgrounds Music Twitter Backgrounds 2 Twitter Backgrounds 101 TERMS OF USE
All About Web Browsers
What is a Web Browser? Mozilla Firefox Internet Explorer Opera How to Set Up Firefox Top 5 Firefox Extensions
 
Contact
Post Some Feedback Send Me An Email Iron Spider Blog About Iron Spider... Site Conventions
 
 
 

 

Checkboxes & Radio Buttons

 
Interactive web forms wouldn't be much fun (or convenient) if all they did was provide a series of text fields for the user to type in their information. Quite often the input that you need would be better obtained by simply supplying a list of choices. The user could then quickly scan through the list and select an applicable item. You can create such lists by using either groups of checkboxes or groups of radio buttons.

Checkboxes


You can prompt users for specific input by using a list of checkboxes. None, one or more checkboxes may be checked by the user according to the information they wish to send with the form. A checkbox is created by using the input element with the type="checkbox" attribute-value pair.

Here is a list of checkboxes prompting the user to select one or more favourite colors.

My favourite colors are:

Red
Yellow
Blue
Orange
Green
Purple

SOURCE CODE

My favourite colors are:<br><br>

<input type="checkbox" name="color" value="red">
Red
<br>

<input type="checkbox" name="color" value="yellow">
Yellow
<br>

<input type="checkbox" name="color" value="blue">
Blue
<br>

<input type="checkbox" name="color" value="orange">
Orange
<br>

<input type="checkbox" name="color" value="green">
Green
<br>

<input type="checkbox" name="color" value="purple">
Purple
<br>


HOW CHECKBOXES WORK

A group of checkboxes is created by giving two or more checkboxes the same control name. In the above example, the checkbox group control name is "color". However each checkbox in the group has a different associated value specified by the value attribute. When a user selects (checks) a checkbox, its value gets assigned as the current value of the checkbox group's control name. A checkbox group's control name may conceivably get paired with several current values if the user selects more than one checkbox.

Radio Buttons


Radio buttons work just like checkboxes except they are typically set up to be mutually exclusive of one another, i.e. when one is selected, all the others are automatically 'deselected'. A radio button is created by using the input element with the type="radio" attribute-value pair.

Here's a group of radio buttons prompting the user to select his current web browser.
Your current web browser is:

Internet Explorer
Mozilla
Opera

SOURCE CODE

Your current web browser is:<br><br>

<input type="radio" name="browser" value="IE" checked>
Internet Explorer<br>

<input type="radio" name="browser" value="Mozilla">
Mozilla<br>

<input type="radio" name="browser" value="Opera">
Opera<br>


HOW RADIO BUTTONS WORK

A group of radio buttons is created by giving two or more radio buttons the same control name. In the above example, the radio button group control name is "browser". However each radio button in the group has a different associated value specified by the value attribute. When a user selects a radio button, its value gets assigned as the current value of the radio button group's control name. Since a selected radio button 'deselects' all other radio buttons within the same group then a radio button group's control name only gets paired with one current value at any one time.


DEFAULT SELECTION

Each radio button group should have a radio button selected by default so that it is implied to the user that only one radio button may be selected at any one time. This is accomplished by inserting the checked attribute. In the above example, the Internet Explorer radio button carries the checked attribute.


Now let's suppose you want to create a list of items for the user to select from but your list is either extensive and/or you don't want to use up alot of space to display it. Well then what you're looking for here is a dropdown menu...





Best Free Stuff
for webmasters

Free Text Editors
Free Graphics Editors
Website Analysis Tools
Free Website Templates

See also:

Best Free Web Hosting

 

If you need a .COM web address, you can get one quick and easy at...

www.GoDaddy.com
<~ BACK TOP NEXT ~>
 
HTML Tutorials |  CSS Tutorials |  Web Hosting |  Domain Names |  Web Design Resources
Iron Spider © Copyright 2004-2011 Robert Darrell