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
 
 
 

 

User Input Components

 
The following pages are for those who need a reference to all the components available to create an advanced web form. All these components may be inserted in the form element in the same manner described in my tutorial on A Simple Feedback Form.

How Forms Work


If you understand what's going on behind-the-scenes of interactive web forms then it will be alot easier to write up the HTML source code that creates them. To this end you should familiarize yourself with two basic features shared by all user input components: control names and current values.

First of all, 'user' refers to the person interacting with the form and 'user input components' refers to all the things in web forms which permit the user to enter information. This information is entered by either typing text into text fields or by making selections from special interactive lists like checkboxes, radio buttons and dropdown menus.

Now you may wonder how forms actually work. For example, once the user clicks on the Submit button how is it possible to discern which information came from which text field? And how does the mere act of clicking on a checkbox or radio button create usable information?

Well the answer to these questions is not "It's magic!" but rather you, the web author, actually set up a special organizational system in the HTML source code of your web form. This system permits the information entered by the user to be properly received and categorized so that it is ready for handling further on down the line (e.g. read by you in an email, entered into a online guestbook, etc).

What happens is that each user input component in the form is given a control name and then when the user comes along and interacts with that component, they assign a value to that control name. The user interacts with one or more components in the form thus assigning a value to their respective control names and then clicks on the Submit button. At this point, the form is processed by a script which is designed to scan for all control names in the form and retrieve their current values.

How to set up this name-value system is described in more detail below.


Control Names


All elements rendering a user input component require a special identifier which is created by inserting the name="control_name" attribute-value pair into the element start tag where control_name equals any name you like. Each user input element or each group of user input elements must have a unique control name.

Although not absolutely necessary when assigning values to the name attribute used in form special elements, it is a good practice to follow these restrictions:
  • Use all lowercase letters.
  • Don't begin the name with a number.
  • Don't use spaces. If you want to use a name with multiple words, use underscores to link the words together e.g. "my_control_name".

Current Values


The value attribute:

In this circumstance, the definition of 'value' may be confusing to newbies. The way to keep it straight is to remember that all HTML attributes have associated values but there is also an HTML attribute called value which itself has a value. Yes I know... They could have made this easier. What can I say? I don't make the rules. I just tell you what they are...
 
As the user interacts with the form, they specify the current value of the input component. In text fields, the value automatically becomes whatever the user types in. With interactive lists like checkboxes, radio buttons and dropdown menus, the value becomes whatever box, button or menu item is selected.

In interactive lists —since the user is not actually typing in a value but rather just clicking to make a selection— you must explicitly associate a value with each input component (i.e. each checkbox, each radio button or each menu item). You do this by inserting the value="value_name" attribute-value pair where value_name equals whatever name you like. It's wise to use a value name which describes the selection the user is making.


*   *   *


More details about all user input components and the name-value system applicable to each are outlined on the following pages. Insert any one or more of the these components in between the <form>...</form> tags to create an interactive web form. For more information about the basic structure of a web form, please see A Simple Feedback Form.

The next page in this tutorial deals with how to make text fields...





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
INTRO TOP NEXT ~>
 
HTML Tutorials |  CSS Tutorials |  Web Hosting |  Domain Names |  Web Design Resources
Iron Spider © Copyright 2004-2011 Robert Darrell