Free Essay

Html Forms

In:

Submitted By ganeshmoorthy
Words 1499
Pages 6
HTML FORMS

Introduction
For a website to be successful, it is important to be able to get feedback from visitors to your site. This could be a request for information, general comments on your site or even a product order. This could be done with a MAILTO: link but providing a form has several advantages over a simple email.
.. It makes it easier for people to send the information
.. A form gives you greater control over the information that is sent.
.. Form results can be organised in a way that makes them easy to store in a spreadsheet or database.
These fields can be added to your forms:
 Text field
 Password field
 Hidden field
 Text area
 Check box
 Radio button
 Drop-down menu
 Submit button
 Reset button
 Image button
Form Handlers
When a form is filled in by a visitor to your site and sent, the results of the form need to be processed in some way. One of the most common ways to process form results is with a CGI (Common Gateway Interface) script. This is a small program that the information entered in to the form is sent to as soon as the form is submitted. The purpose of this script is to accept the results of a form, organise the results and send the results to an appropriate location, such as a text file, database or email address. In these exercises we won’t go into creating CGI scripts since that is quite different from HTML and requires some programming knowledge. There are many free CGI scripts on the Internet that you can download and use for your own forms.1 Many ISPs (Internet Service Providers) also provide scripts for the use of their users so you can often get by without having to learn how to create your own scripts. In addition to CGI there are some other technologies available for linking forms with databases such as Microsoft’s Active Server Pages (ASP), PHP and Allaire’s Cold Fusion.

The FORM Tag
Forms are placed in your document using a tag which must have a closing tag. You can have more than one form in a document as long as they don’t overlap. I.e. one form must finish before the next one begins. A tag specifies two main things.
.. The location of the program or script used to process the results of the form and send them to an appropriate location
.. The method that will be used to send data from the form
The layout of the form is specified by the form fields. These can be placed anywhere between the and tags.

Each of the various input types is described below.
TYPE="text"
A text input element is for entering a small amount of text. It uses an tag with a TYPE=”text” attribute. It uses the NAME=, SIZE=, MAXLENGTH=, ALIGN=, TABINDEX= and VALUE= attributes.
• The size option defines the width of the field. That is how many visible characters it can contain.
• The maxlength option defines the maximum length of the field. That is how many characters can be entered in the field.
• If you do not specify a maxlength, the visitor can easily enter more characters than are visible in the field at one time.
• The name setting adds an internal name to the field so the program that handles the form can identify the fields.
• The value setting defines what will appear in the box as the default value.
• The align setting defines how the field is aligned.
Valid entries are: TOP, MIDDLE, BOTTOM, RIGHT, LEFT, TEXTTOP, BASELINE, ABSMIDDLE, ABSBOTTOM. The alignments are explained in the image section. You can learn about the different alignments here.
• The tabindex setting defines in which order the different fields should be activated when the visitor clicks the tab key.
Example
Name:
TYPE="password"
This is the same as a text field except that any characters entered will appear as * as they are typed. It has all the same attributes as a text input field except that there is no VALUE attribute.
Example
Password:

TYPE="checkbox"
A checkbox input can be used for boolean fields where there are only two choices. It can use the NAME=, VALUE= and CHECKED attributes. When several checkbox inputs share the same name, their results will be put into the same field. This allows users to select more than one value for a category.
Example
Member:

TYPE="radio"
Radio inputs allow a user to select from several options where only one can be selected. Each option in a list has its own tag and each must have the same name. One option can be pre-selected with the CHECKED attribute.
Example
Note that the < and > special characters have been used to display the less than < and greater than > symbol.
Age <=20:
Age 21-30:
Age 31-40:
Age >40:

TYPE="file"
This field allows a user to specify the name of a file to be sent as an attachment with the form results. Normally a browse button will appear next to the field to allow the user to browse for the location of the file on their computer. The NAME=, SIZE= and MAXLENGTH= attributes may be used. File inputs are not widely supported in browsers.
Example
File to send:

TYPE="hidden"
Some CGI scripts make use of hidden fields within the form to accept additional parameter information (such as an email address to send the results to or a subject for the email). These are passed to the server when the form is submitted. Normally they will contain a NAME= and VALUE= attribute.
Example

This might be used to provide a subject for the form results when they are sent to an email address. Forms may also have hidden fields to do things like specify an email address to send the results to or specify an html file to display once the results are submitted (confirmation page).
TYPE="submit" and TYPE="reset" These inputs both provide buttons that affect the results of the form. Both have a VALUE= attribute which determines the text to appear on the button. A submit button can also have a NAME= attribute. When a user clicks a submit button, the results of the form will be sent. When a user clicks a reset button, the contents of the form’s fields are set to their initial state.
Example

TYPE="image" This type of input can be used in place of a submit button. Instead of a button, it will show an image, which will submit the form results when it is clicked. This type of input typically has a NAME= and SRC= attribute but it can also include attributes common to IMG tags such as ALIGN=. Although an image can look a lot better than a plain submit button, image inputs can cause difficulties with text browsers.
Example

Select Menus
As the name implies, select menus allow a user to select from a list of options. The menu begins with a tag and ends with a tag. The select tag has the following attributes.
MULTIPLE
This attribute enables more than one option to be selected by holding down the [CTRL] key, which is useful for certain types of forms. Particularly when used with an online database.
NAME=
Name of the list that will be used in the results to identify the field.
SIZE=
Number of rows to appear in the list. The default is 1, which will mean that one option will be visible but an arrow will appear to the right. This arrow will bring down a list when clicked. If values of more than 1 are set, the list will show that number of rows with a scroll bar on the side. Within the select tag, each item in the list is set with an tag. An option tag may have the following attributes.
SELECTED
One option in the list can have this attribute, which will mean that particular option will be initially selected.
VALUE=
Value that will be submitted with the form. If no value is specified, the text in the list itself will be used.
Text Areas Text areas are used where a large amount of text needs to be entered. Common examples are where you want to provide a space on the form for comments to be entered. Text areas begin with a tag and end with a tag. Anything between the start and end tag will appear in the field on the page. If there is nothing between the start and end tag, the field will be blank to start with. Text areas can have the following attributes.
COLS=
Width of the field in characters. The width of a text area will be quite different in Internet Explorer and Netscape Navigator so don’t count on getting them consistent.
ROWS=
Number of rows that will appear.
NAME=
Name of the text area that will be used in the results to identify the field.
Example
Comments: Enter your comments here

Similar Documents

Premium Essay

Html Text

...HTML, DHTML & JavaScript HTML, DHTML & JavaScript PRAVESH – Student Guide Subject: HTML. DHTML & JavaScript V1.0 Training & Development Division Page 1 of 282 HTML, DHTML & JavaScript Chapter 1: Introduction to Web and Internet...................................................................................3 Chapter 2: HTML's Role on the Web...........................................................................................13 Chapter 3: Creating a Web Page and Entering Text ....................................................................24 Chapter 4: Changing and Customizing HTML Text....................................................................33 Chapter 5: Displaying Text in Lists .............................................................................................43 Chapter 6: Adding Graphics to Your Web Pages.........................................................................54 Chapter 7: Hypertext and Creating Links.....................................................................................64 Chapter 8: Clickable Image Maps and Graphical interfaces........................................................74 Chapter 9: HTML Forms..............................................................................................................85 Chapter 10: Images, Multimedia Objects and Background Graphics ..........................................96 Chapter 11: Adding Tables to your Documents.............................

Words: 56638 - Pages: 227

Free Essay

Web Tehnology

...know Must know HTML & CSS JavaScript Not so important jQuery Ruby on Rails Python, PHP, etc Nice to know Automated Testing BDD - Behavior Driven Development TDD - Test Driven Development etc Databases Why Angular? If you’re using JavaScript to create a dynamic website, Angular is a good choice. • Angular helps you organize your JavaScript • Angular helps create responsive (as in fast) websites. • Angular plays well with jQuery • Angular is easy to test Traditional Page-Refresh Screencast: Request-Response Application NOTE: Time between user 
 interaction and response. Web Server Web Browser URL Request to server HTML JavaScript Response with Webpage & Assets Browser loads up entire webpage. User clicks on link, new Request HTML JavaScript Response with Webpage & Assets Browser loads up entire webpage. A “responsive” website using Angular Screencast: Request-Response Application NOTE: Note how responsive the page is Web Server Web Browser URL Request to server HTML JavaScript Response with Webpage & Assets Browser loads up entire webpage. User clicks on link, new Request DATA Response with JSON Data Data is loaded into existing page. Modern API-Driven Application Server Data Source HTML API Mobile App Developers Browser App What is Angular JS? A client-side JavaScript Framework for adding interactivity to HTML. How do we tell our HTML when to trigger...

Words: 1118 - Pages: 5

Free Essay

Html

...1. HTML stands for what? Hyper Text Markup Language 2. The end tag is written like the start tag, with a forward slash before the tag name. 3. Start and end tag are also called opening tags and closing tags. 4. "HTML tags" and "elements" are often used to describe the same thing. 5. An HTML element is everything between the start tag and the end tag, including the tags 6. The purpose of a web browser is to read HTML documents and display them as web pages. 7. HTML elements with no content are called empty elements. 8. HTML headings are defined with the <h1> to <h6> tags. 9. HTML paragraphs are defined with the <p> tag. 10. Links are specified in HTML using the <a> tag. 11. The href attribute Specifies the destination of a link. 12. The target attribute Specifies where to open the linked document. 13. HTML images are defined with the <img /> tag. 14. The <hr /> tag creates a horizontal line in an HTML page 15. Which tag defines HTML comments tag? <!-- --> 16. Which tag defines HTML line Breaks? <br /> 17. Which tag defines BOLD text? <b> 18. Which tag defines italic text? <i> 19. Which tag defines an emphasized text? <em> 20. Which tag defines small text? <small> 21. Which tag defines strong text? <strong> 22. Which tag defines subscripted text? <sub> 23. Which tag defines superscripted text? <sup> ...

Words: 606 - Pages: 3

Free Essay

Html

...HTML & CSS Design and Build Websites Jon Duckett John Wiley & Sons, Inc. HTML & CSS Design and build Websites Published by John Wiley & Sons, Inc. 10475 Crosspoint Boulevard Indianapolis, IN 46256 www.wiley.com ©2011 by John Wiley & Sons, Inc., Indianapolis, Indiana ISBN: 978-1-118-00818-8 Manufactured in the United States of America Published simultaneously in Canada 10 9 8 7 6 5 4 3 2 1 No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 7486011, fax (201) 748-6008, or online at http://www.wiley.com/go/permissions. Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including without limitation warranties of fitness for a particular purpose. No warranty may be created or extended by sales...

Words: 83244 - Pages: 333

Free Essay

Mr.Sdfasdf

...left column with the appropriate definition in the right column. 1. Extensible Markup Language (XML) 2. Standard Generalized Markup Language (SGML) 3. WCAG 4. Tags 5. Extensible Hypertext Markup Language (XHTML) 6. Hypertext Markup Language (HTML) 7. Markup language 8. Hyperlink A. An ISO-standard language used to describe data and context as opposed to its appearance B. Embedded information that defines the font, color and phrase elements used on an HTML page C. Language that describes context and/or formatting for online documents D. Newer language used to define context as opposed to appearance E. Embedded instructions within a text file that link it to another point in the file or to a separate file F. Web language standard that separates responsibilities for organizing and formatting data G. Language used primarily for defining format and appearance of Web documents H. A set of guidelines for ensuring Web site accessibility to all users, including those with disabilities 1-D, 2-A, 3-H, 4-B, 5-F, 6-G, 7-C, 8-E © 2012 Certification Partners, LLC. — All Rights Reserved. Version 2.0 Site Development Associate Activity Answers-2 Activity 2-1: Identifying HTML elements and attributes In this activity, you will match the HTML element or attribute in the left column with the appropriate description in the right column. 1. 2. 3. 4. 5. 6. 7. 8. 9. lang style A. A container tag that encloses the text that will appear at the top of the browser window, and as the...

Words: 2803 - Pages: 12

Premium Essay

Html

...HTML Beginner's Guide htmldog.com This HTML Beginner's Guide assumes that you have no previous knowledge of HTML or CSS. It should be quite easy to follow if you work through each step, which are all brought together at the end, before moving on to the CSS Beginner's Guide. The thing to keep in mind is that HTML and CSS are all about separating the content (HTML) and the presentation (CSS). HTML is nothing more than fancy structured content and the formatting of that content will come later when we tackle CSS. If you have looked at other HTML tutorials, you may find that they mention certain things that HTML Dog does not. This is because many methods are obsolete, non-standard or just plain bad practice. Getting into the frame of mind of doing things the RIGHT way from the start will turn in to much better results in the end. Getting Started Most of the stuff on the web is no different than the stuff on your computer it's just a whole load of files sorted into a whole load of directories. HTML files are nothing more than simple text files, so to start writing in HTML, you need nothing more than a simple text editor. Notepad is a common example (on Windows this is usually found under the Programs > Accessories menu). Type this in to your text editor: This is my first web page Now create a folder called 'html' and save the file as 'myfirstpage.html' (it is important that the extension '.html' be specified - some text editors, such as Notepad, will automatically save it as...

Words: 2252 - Pages: 10

Free Essay

Www's History and Such

...1989: Tim Berners-Lee invents the Web with HTML as its publishing language The World Wide Web began life in the place where you would least expect it: at CERN, the European Laboratory for Particle Physics in Geneva, Switzerland. CERN is a meeting place for physicists from all over the world, where highly abstract and conceptual thinkers engage in the contemplation of complex atomic phenomena that occur on a minuscule scale in time and space. This is a surprising place indeed for the beginnings of a technology which would, eventually, deliver everything from tourist information, online shopping and advertisements, financial data, weather forecasts and much more to your personal computer. Tim Berners-Lee is the inventor of the Web. In 1989, Tim was working in a computing services section of CERN when he came up with the concept; at the time he had no idea that it would be implemented on such an enormous scale. Particle physics research often involves collaboration among institutes from all over the world. Tim had the idea of enabling researchers from remote sites in the world to organize and pool together information. But far from simply making available a large number of research documents as files that could be downloaded to individual computers, he suggested that you could actually link the text in the files themselves. In other words, there could be cross-references from one research paper to another. This would mean that while reading one research paper, you could quickly...

Words: 6284 - Pages: 26

Free Essay

Term Paper

...(Tables) (Colors) (Background) (Frame) (Layout) (Embed Music) (Vedio) (body) (Div) ( HTM Tut or i al i n L + + (Form) (Upload) : • Hypertext Markup Language. , । • • • । PHP+Database • Driven WebSite । । webcoachbd.com ( Notepad open Netbeans or Dreamweaver. • • • ) । (Elements) (Tag) (Attribute) >> ( HTM El em L ent s) : (Elements): (tag) page (Element) (closing tag) । HTML HTML Paragraph text, , HTML page Web elements (opening tag) , । 1.

- opening paragraph tag 2. Element Content - paragraph words 3.

- closing tag Web page (Element) elements । । : HTML,head, title body Element... HTML HTML । Welcome to Bangladesh Web page Notepad Open start All Programs > Accessories >Notepad Notepad 1. 2.Welcome to Bangladesh 3. less than greater than ( < >) : Welcome to Bangladesh । Notepad Web page Notepad Double click Page । save open । index.html Browser save open । web element head, elements element <head> closing() tag browser <head> elements header । head title elements । opening (<title>) 1.<html> 2.<head> 3.<title> My WebPage! 4. 5. element body element web page body element । 1. 2. 3.My WebPage! 4. 5. 6.Hello World! All my content goes here! 7. 8. web page .html extension । ( HTM Tag Tut or i al i n Bangl a) L : , paragraph . . . paragraph (opening tag) (contents)...

Words: 6504 - Pages: 27

Premium Essay

Course Design Guide It/237

...Markup Language (HTML), scripting, and presentational technologies to create ™ websites without the aid of a software authoring application. Topics include XHTML, CSS, JavaScript , server hosting, site publication, site maintenance, and search engine optimization. Policies Faculty and students will be held responsible for understanding and adhering to all policies contained within the following two documents:   University policies: You must be logged into the student website to view this document. Instructor policies: This document is posted in the Course Materials forum. University policies are subject to change. Be sure to read the policies at the beginning of each class. Policies may be slightly different depending on the modality in which you attend class. If you have recently changed modalities, read the policies governing your current class modality. Course Materials Bojack, H. (2010). New perspectives on blended HTML, XHTML, and CSS: Introductory (2nd ed). Mason, OH: Cengage Learning. Gosselin, D. (2011). JavaScript (5th ed.). Mason, OH: Cengage Learning. Software Dreamweaver CS5 provided through Toolwire ® ® All electronic materials are available on the student website. Week One: Introduction to HTML and XHTML Details Objectives 1.1 Identify basic HTML tags and attributes. 1.2 Compare basic XHTML tags and attributes to DHTML and HTML. 1.3 Explain the importance of viewing and testing markup code in various web browsers. 1.4 Develop HTML code that displays...

Words: 3465 - Pages: 14

Free Essay

10 Major Advantages of Html5

...with the help of Flash or Silverlight, Flex or javascript like tools. But these consume so much time to develop and even the complexity of web application also increased. But now with the help of HTML5 it is possible to embed video and audio, high quality drawings, charts and animation and many other rich content without using any plugins and third party programmas as the functionality is built into the browser. 2. Cleaner markup / Improved Code HTML 5 will enable web designers to use cleaner, neater code, we can remove most div tags and replace them with semantic HTML 5 elements. 3. Improved Semantics Now it is easy to see which parts of the page are headers, nav, footers, aside, etc as the tags are specific for these all and most importantly know what their meaning and purpose is in whole the format. By using HTML5 elements we can increase the semantic value of the web page as the codes are very standardized. 4. Elegant forms HTML5 enables designer to use more fancier forms. Even it makes form validation native to HTML, User interface enhancements and reduced need for JavaScript (only needed in browsers that don’t...

Words: 889 - Pages: 4

Free Essay

Test

...HTML About the tutorial Tutorial HTML Tutorial Simply Easy Learning 2 HTML Tutorial About the tutorial HTML Tutorial HTML stands for Hyper Text Markup Language, which is the most widely used language on Web to develop web pages. HTML was created by Berners-Lee in late 1991 but "HTML 2.0" was the first standard HTML specification which was published in 1995. HTML 4.01 was a major version of HTML and it was published in late 1999. Though HTML 4.01 version is widely used but currently we are having HTML-5 version which is an extension to HTML 4.01, and this version was published in 2012. Audience This tutorial is designed for the aspiring Web Designers and Developers with a need to understand the HTML in enough detail along with its simple overview, and practical examples. This tutorial will give you enough ingredients to start with HTML from where you can take yourself at higher level of expertise. Prerequisites Before proceeding with this tutorial you should have a basic working knowledge with Windows or Linux operating system, additionally you must be familiar with:      Experience with any text editor like notepad, notepad++, or Editplus etc. How to create directories and files on your computer. How to navigate through different directories. How to type content in a file and save them on a computer. Understanding about images in different formats like JPEG, PNG format. Copyright & Disclaimer Notice All the content...

Words: 5524 - Pages: 23

Premium Essay

Introduction to Java

...of their website than HTML and CSS can provide. By definition, JavaScript is a client-side scripting language. This means the web surfer's browser will be running the script. The opposite of client-side is server-side, which occurs in a language like PHP. PHP scripts are run by the web hosting server. How To Write JavaScript If you have ever used CSS before, you will find the whole part about including JavaScript will be a lot simpler to grasp. Here are Tizag's three important steps you should always follow when creating or using someone else's JavaScript code: 1. Use the script tag to tell the browser you are using JavaScript. 2. Write or download some JavaScript 3. Test the script! There are so many different things that can go wrong with a script, be it human error, browser compatibility issues, or operating system differences. So, when using JavaScript, be sure that you test your script out on a wide variety of systems and most importantly, on different web browsers. Your First JavaScript Script To follow the classic examples of many programming tutorials, let's use JavaScript to print out "Hello World" to the browser. I know this isn't very interesting, but it will be a good way to explain all the overhead required to do something in JavaScript. HTML & JavaScript Code: <html> <body> <script type="text/JavaScript"> <!-- document.write("Hello World!") //--> </script> </body> </html> Display: Hello World...

Words: 9622 - Pages: 39

Free Essay

Advance Web Development

...Q.1 Discuss the Following: * Internet Domain * A domain name is a unique name that identifies a website. For example, the domain name of the Google is "google.com." Each website has a domain name that serves as an address, which is used to access the website * Whenever you visit a website, the domain name appears in the address bar of the web browser. Some domain names are preceded by "www" while others omit the "www" prefix. * All domain names have a domain suffix, such as .com, .net, or .org. The domain suffix helps identify the type of website the domain name represents. For example, ".com" domain names are typically used by commercial website, while ".org" websites are often used by non-profit organizations * NOTE: When you access a website, the domain name is actually translated to an IP address, which defines the server where the website located. This translation is performed dynamically by a service called DNS. * Web Server * A Web server is a computer system that hosts websites. It runs Web server software, such as Apache or Microsoft IIS, which provides access to hosted webpages over the Internet. Every Web server has an IP address and possibly a domain name. For example, if you enter the URL http://www.google.com in your browser, this sends a request to the Web server whose domain name is google.com. * Any computer can be turned into a Web server by installing server software and connecting the machine to the Internet...

Words: 5169 - Pages: 21

Free Essay

Privacy Technology

...unfinished privacy policy form Case3: Upload Json file and continue finishing questionnaire Why Struts? 1 3 4 5 5 6 6 6 Functionality Start. Modification. Submission. 9 9 9 9 Design Rationale Web-based. Easy to use. Model form regulation satisfied. Hyperlinks to relevant opt-out mechanisms. Logical consistency. Computer-readable version. Preview generated policy. HTML and CSS outputs. 11 11 11 11 11 12 13 13 13 COPYRIGHT TEAM7 !2 Executive Summary ! The objective of this project is to develop a web-based tool, Interactive Form Builder (IFB), required by United States Federal Trade Commission (FTC). The tool is designed and developed for financial institutions to generate web-based, interactive privacy notices that comply with the model form regulation published by eight federal regulators on December 1, 2009, under the Gramm-Leach-Bliley Act. The report discusses the system architecture for this project. It also covers how we address each requirement specifically for the Interactive Form Builder.
 COPYRIGHT TEAM7 !3 Introduction The current in use Online Form Builder enables the financial institutions to produce a PDF version of notice. However, the created PDF notice is reported containing errors and lack of consistency. Furthermore, while converting the PDF to HTML, the static one doesn’t facilitate hyperlinks to allow users to opt out directly. In order to address those problems, the Interactive Form Builder we have designed...

Words: 2198 - Pages: 9

Free Essay

Html Introduction

...acknowledgment is made explicitly in the text, nor has any part been written for me by another person. Student’s Signature : _____________ Evaluator’s comments: _____________________________________________________________________ Marks obtained : ___________ out of ______________________ ------------------------------------------------- Content of Homework should start from this page only: ------------------------------------------------- Q1: How the HTML documents are structured? Discuss according to the logical and physical elements. (5) Ans: An HTML 4 document begins with a DOCTYPE declaration that declares the version of HTML to which the document conforms. The HTML element follows and contains the HEAD and BODY. The HEAD contains information about the document, such as its title and keywords, while the BODY contains the actual content of the document, made up of block-level elements and inline elements. A basic HTML 4 document takes on the following form: <!DOCTYPE html> <HTML> <HEAD> <TITLE>The document title</TITLE> </HEAD> <BODY> <H1>Main heading</H1> <P>A paragraph.</P> <P>Another paragraph.</P> <UL> <LI>A list item.</LI> <LI>Another list item.</LI> </UL>...

Words: 2895 - Pages: 12