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
 
 
 

 

Push Buttons

 
Okay so, presumably, you know how to populate your web form with various user input components like text fields, checkboxes, radio buttons and dropdown menus. All that remains now is to provide a means to submit the form. You may also want to offer the option to upload a file or reset the form back to its original state in case the user makes a mistake and wishes to start over. These actions are all accomplished by clicking on a button and you create buttons by using either the input element or the button element.

input element buttons


The input element with the type attribute is used to create various button types. The value attribute may be used with the Submit, Reset and Button type buttons to create the text written on the button. In the absence of the value attribute, the default text for the button type is used. Remember that the input element only requires the <input> start tag (end tag is omitted).

All the input element button types are outlined below:

  • Submit ~ Clicking on the Submit button type will call up the form script to process the contents of the form. It is created by using the input element with the type="submit" attribute-value pair.

    Example:



    SOURCE CODE

    <input type="submit" value="Submit Information">



  • Reset ~ Clicking on the Reset button type will reset all user input components in the form (i.e. text fields, checkboxes, radio buttons and dropdown menus) back to their default values. The reset button is created by using the input element with the type="reset" attribute-value pair.

    Example:



    SOURCE CODE

    <input type="reset" value="Reset form">



  • File ~ Clicking on the File button type will permit the user to select a file on his computer to upload when the form is submitted. The File button type is created by using the input element with the type="file" attribute-value pair.

    Example:



    SOURCE CODE

    <input type="file">


    Note that the value attribute for the File button type applies to the initial file name instead of the button text. The button text in this instance is defined by the browser displaying the web page. Internet Explorer and Mozilla will display "Browse...". Opera will display "Choose".


  • Image ~ This button type creates a graphical submit button. Clicking on it will call up the form script to process the contents of the form. It is created by using the input element with the type="image" attribute-value pair. The src="graphic file name" attribute-value pair specifies the graphic to be used where graphic file name equals the file name of the image you wish to use to create the button. (See Graphics 1 - The Essentials for more information about using graphics on web pages.) The value attribute is inapplicable.

    Example:



    SOURCE CODE

    <input type="image" src="button.jpg">



  • Button ~ This button type creates a generic button which doesn't do anything by default. This is the kind of button to use when you don't want to actually create a web form but you want to create a button that users can click on to trigger some sort of action. It is typically used with the onclick event handler to activate a javascript.

    Example:



    SOURCE CODE

    <input type="button" value="Open new window" onclick="window.open('test.htm','test');">


^ Top ^


button element buttons


You can use the button element instead of the input element to exercise much more control over how your button looks. The key differences between using the input element and the button element to create buttons are:
  • The button element may be used to create the submit, reset and button type buttons only.
  • The button element requires both start and end tags, e.g. <button>...</button>
  • The button element may actually contain other HTML elements offering you many more options on how to format your button. This includes bold, italicised, colored and resized text, images, tables and more.

Here are some examples:



SOURCE CODE

<button type="submit"><b><i>Submit Info</i></b></button>






SOURCE CODE

<button type="reset"><font face="times new roman" size="4" color="green">Reset All Form <br>Components</font></button>






SOURCE CODE

<button type="button" onclick="window.open('test.htm');">
<table cellpadding="5" cellspacing="0" border="0">
<tr><td colspan="2">Open a new window</td></tr>
<tr><td><img src="point-right.gif"></td>
<td><img src="new-window.gif"></td></tr>
</table></button>




*   *   *


Now let's imagine that you want alot of input from your user (e.g. tell me your life story). So you slapped together a form and then took a look at it and realized that what you have is a virtual morass of text fields, radio buttons, checkboxes, etcetera, that is most likely to send your user running out of the room screaming. What to do?

Well, as mentioned earlier, you can always wrap your user input components in other HTML elements to keep the appearance of your web form down to a dull roar. Tables are especially useful in this situation. However there are some special presentational elements that can be used in web forms that might be better suited to the occasion. To learn about these and to see an example of an advanced web form, continue on to Layout and Presentation...





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