Viewing Form Results



Similar documents
<option> eggs </option> <option> cheese </option> </select> </p> </form>

07 Forms. 1 About Forms. 2 The FORM Tag. 1.1 Form Handlers

Further web design: HTML forms

Upload Center Forms. Contents. Defining Forms 2. Form Options 5. Applying Forms 6. Processing The Data 6. Maxum Development Corp.

By Glenn Fleishman. WebSpy. Form and function

Inserting the Form Field In Dreamweaver 4, open a new or existing page. From the Insert menu choose Form.

Internet Technologies

Using Form Tools (admin)

CS412 Interactive Lab Creating a Simple Web Form

FORMS. Introduction. Form Basics

Tutorial 6 Creating a Web Form. HTML and CSS 6 TH EDITION

HTML Forms. Pat Morin COMP 2405

2- Forms and JavaScript Course: Developing web- based applica<ons

Web Design and Development ACS Chapter 13. Using Forms 11/30/2015 1

Introduction to XHTML. 2010, Robert K. Moniot 1

HTML Form Widgets. Review: HTML Forms. Review: CGI Programs

HTML Forms and CONTROLS

XHTML Forms. Form syntax. Selection widgets. Submission method. Submission action. Radio buttons

HTML Tables. IT 3203 Introduction to Web Development

Configuring iplanet 6.0 Web Server For SSL and non-ssl Redirect

FORM-ORIENTED DATA ENTRY

Dreamweaver Tutorials Creating a Web Contact Form

Designing and Implementing Forms 34

CGI Programming. What is CGI?

HOW TO CREATE AN HTML5 JEOPARDY- STYLE GAME IN CAPTIVATE

understand how image maps can enhance a design and make a site more interactive know how to create an image map easily with Dreamweaver

PDG Software. Site Design Guide

Form And List. SuperUsers. Configuring Moderation & Feedback Management Setti. Troubleshooting: Feedback Doesn't Send

Cognos 10 Getting Started with Internet Explorer and Windows 7

SerialMailer Manual. For SerialMailer 7.2. Copyright Falko Axmann. All rights reserved.

Instructions For Opening UHA Encrypted

CREATING WEB FORMS WEB and FORMS FRAMES AND

Configuring Notifications for Cisco Unified MeetingPlace Express

At the end of this lesson, you will be able to create a Request Set to run all of your monthly statements and detail reports at one time.

EDITOR & SITE TAGS

Setting up SMTP in Talis Decisions

Salesforce Integration

Web Development. Owen Sacco. ICS2205/ICS2230 Web Intelligence

In order for the form to process and send correctly the follow objects must be in the form tag.

Reference Guide for WebCDM Application 2013 CEICData. All rights reserved.

Print Audit 6 - SQL Server 2005 Express Edition

Securepoint Security Systems

XHTML BASICS. Institute of Finance Management CIT Department Herman Mandari

To create a new Campaign, click into the Marketing module. Then, click on Campaigns button.

Now that we have discussed some PHP background

Viral Mail Profits. Mailing to the Max! User's Guide

An Introduction To The Web File Manager

emarketing Manual- Creating a New

COLLABORATION NAVIGATING CMiC

Creating a User Profile for Outlook 2013

1&1 SEO Tool Expert Call

How To Encrypt a File using Windows Explorer and WinZip. For Use With All PII Data

Lesson Review Answers

JavaScript and Dreamweaver Examples

Short notes on webpage programming languages

How to Schedule Report Execution and Mailing

SAM Server Utility User s Guide

NewsletterAdmin 2.4 Setup Manual

Empowered by Innovation. Setting Up and Using Fax Mail. P/N July 2006 Printed in U.S.A.

User Guide for Kelani Mail

For paid computer support call

WebCUR ListServ. ListServ Help Manual

Amicus Link Guide: Outlook/Exchange

Composite.Community.Newsletter - User Guide

Install MS SQL Server 2012 Express Edition

Linklok URL TM V2.90

Google Trusted Stores Setup in Magento

How to Make a Working Contact Form for your Website in Dreamweaver CS3

Working with forms in PHP

MyFaxCentral User Administration Guide

STATGRAPHICS Online. Statistical Analysis and Data Visualization System. Revised 6/21/2012. Copyright 2012 by StatPoint Technologies, Inc.

InPost UK Limited GeoWidget Integration Guide Version 1.1

Web Hosting Training Guide. Web Hosting Training Guide. Author: Glow Team Page 1 of 22 Ref: GC349_v1.1

FACILITIES INVENTORY MANAGEMENT SYSTEM:

Making a Web Page with Microsoft Publisher 2003

Configuring Alarm s From The Field Logger DL1080/DL1081 Using SMTP2GO As The Outgoing Server

Skipjack Merchant User Guide. Quick Guide. (a supplement to the Merchant User Guide)

SQL Server Setup for Assistant/Pro applications Compliance Information Systems

Build an ArcGIS Online Application

Weston Public Schools Virtual Desktop Access Instructions

Designing for Dynamic Content

Chapter 15: Forms. User Guide. 1 P a g e

Human Computer Interaction Final Project Tutorial. Hardware Inventory Management System (HIMS) By M. Michael Nourai

FRONTPAGE FORMS

Configure Cisco Emergency Responder Disaster Recovery System

RoboMail Mass Mail Software

Process Document Campus Community: Create Communication Template. Document Generation Date 7/8/2009 Last Changed by Status

Initial Setup of Microsoft Outlook with Google Apps Sync for Windows 7. Initial Setup of Microsoft Outlook with Google Apps Sync for Windows 7

Website Planning Checklist

Changing Passwords in Cisco Unity 8.x

Deleted Cookies Cause Online Banking Users to be Asked For Secure Code at Each Login

BC OnLine. Configuring Your Web Browser for BC OnLine. Last Updated January 27, 2016

JAVASCRIPT AND COOKIES

Configuring Thunderbird for Flinders Mail at home.

How To Filter Spam With Thunderbird On A Pc Or Macintosh (Sailor) On A Macintosh Or Macbook) On Pc Or Ipa (Macintosh) On An Ipa Or Ipam (Soulbird) On Windows

Transcription:

Form Tags XHTML

About Forms Forms allow you to collect information from visitors to your Web site. The example below is a typical tech suupport form for a visitor to ask a question. More complex forms can be used to place online orders, give online exams, make database updates, and more.

Viewing Form Results To see the results of a submitted form requires an program on the server to process the form. Though it is not within the scope of this course to cover server-side programming, we will describe a server-side program we can used to display the form results without doing any programming.

Forms and Form Variables Forms are used to collect user data and submit it to a CGI script or other program on the server capable of processing form data. In order for the form data to be processed correctly, the variable names in the form and in the CGI script must be identical. Form variables that do not have matching variables in the CGI script will be ignored during processing. The example below illustrates the variable names that will be used in the form examples in this lesson and then passed to a CGI script.

CGIecho and CGIemail Unless you are a programmer, you will need a prewritten CGI Script to handle form processing. A very popular choice for processing form data is CGIecho/CGIemail. The CGIecho script is used for testing a form's output, while CGIemail is used for sending the processed form data via email. We will use CGIecho for testing all the examples and exercises in this lesson.

Formatting the Template File CGIecho/CGIemail requires a simple text file called a template to format form data. The template file contains both variables and free form text. Notice below that the text within the template is not restricted. Square brackets are placed around variable names "[variablename]", which the CGI script will replace with the variable values passed by the form. The name of the template file, "form.txt", can be any valid filename.

<form> Tag The <form> tag starts a form and the </form> tag ends it. All other tags associated with forms will not function unless they are inside <form></form> tags. Note that when editing forms, you often must hold down the "Shift" key while hitting "Reload"/"Refresh" in order to see your changes. On rare occasions, you will need to restart the browser to see edit changes to forms. If restarting the browser does not fix a form problem, then there is a mistake in the form itself. The form below is not complete; therefore the submit button does not function.

Method & Action Attributes The previous example would not submit information because there were no form attributes describing what to do on submit. The "method" attribute, which determines how your form data is sent, can have a value of "get" or "post," but "method="post"" is the most common. Next, the "action" attribute points to the script that will process the form. This example points to "cgiecho," which is a common testing tool for processing form email. Submitting this form example results in a list of all the variable names supported by this test script.

Type Attribute With the form framework in place, we can now add functionality to the form. By default, the <input /> tag indicates a text input field. In the example below, the "type" attribute has been set to "text," but it is not required. The <input /> tag has no closing tag, thus the " /" (there is a space before the slash) is placed at the end of the tag to make it XHTML compliant.

Name Attribute The "name" attribute is used to define the variable name that will pass data. For the data in the variable name to be processed, it must match the variable name in the processing script exactly. Variable names are case sensitive.

Value Attribute The "value" attribute defines the default value for the input variable. If the value attribute is not used, a default value of "null" is assigned to the variable. The "size" attribute is used to set the length of the text input window, whereas the "maxlength" attribute defines how many characters of input will be accepted.

<input> Tag To submit form data, use the <input /> tag, with the "type" attribute set to "submit." You can control the text on the submit button by setting the "value" attribute.

Type Attribute To input a text field as a password, use the <input /> tag with the "type" attribute set to "password." The input field will display an "*" each time a key is pressed.

Type Attribute In any form, to give the user a way to reset form data to the defaults, use the <input /> tag with the "type" attribute set to "reset." You can control the text on the reset button by setting the "value" attribute.

Form Check Boxes To input data using check boxes, use the <input /> tag with the "type" attribute set to "checkbox." The variable names used with each check box must be the same as the ones used in the processing script, or the data will not be collected. By default, any check boxes that are checked submit a value of "on," while unchecked boxes send no value. Notice that only the values for the check boxes under "Kitchen" show up in the results, since they use variable names that are recognized by the test script ("data1" through "data5").

Value Attribute Add the "value" attribute to define the data sent when a check box is checked. In this example, all items send descriptive values instead of "on."

Checked Attribute By default, check boxes are unchecked. You can establish the check box default as checked by using the "checked" attribute.

Form Radio Buttons To collect data using radio buttons, use the <input /> tag with the "type" attribute set to "radio." The variable names used with radio buttons must be the same as the ones used in the processing script or the data will not be collected. By default, checked radio buttons submit a value of "on," while unchecked buttons send no value. Notice that all items under "Kitchen" use the same variable name (the same is true for the items under "Bathroom"). This is because a group of radio buttons permit the selection of only one choice from a list of options.

Value Attribute The "value" attribute can be added to the <input /> tag to define the data sent when a radio button is checked. In the example below, all items have descriptive values instead of "on."

Checked Attribute By default, radio buttons are unchecked. A radio button's default can be set as checked with the "checked" attribute, however, only one radio button per group should be checked (a group of radio buttons uses the same variable name). In this example, "Cups" is checked for the data1 variable and "Soap" is checked for the data2 variable.

Form Pull-Down Menu To input data using a pull down menu, use the <select> tag with the "name" attribute set to a variable used in the processing script. Next, define the items in the pull down menu using the <option> tag. The closing </option> tag is required in XHTML. By default, the top item in the menu is selected, but you can set the default to any item in the menu by using the "selected" attribute inside one of the <option> tags contained within a <select> tag.

Form Scrollable Menu To input data using a scrollable menu, add the "size" attribute to the previous example. With "size="4"," the first column doesn't scroll because it has only 4 items, the second scrolls since it has 5 items, and the third makes room for four items, but only displays two items on the menu. In this case, add the "selected" attribute if you wish to set a default value.

Form Text Areas To input data using a text area (aka "edit window"), use the <textarea> tag. Place any default text for the edit window between the opening and closing <textarea> </textarea> tags. The "rows" attribute defines how many text rows tall the edit window is, while the "cols" attribute defines how wide it is.

Form "Cancel" Button There is no defined "Cancel" feature in HTML, so we will improvise. To add a cancel button to any form, you make a separate form with the "method" attribute set to "get" and the "action" attribute pointing to an HTML file to be loaded when the cancel button is clicked. The cancel button is simply a submit button with the button text set to "Cancel Form."

Create a form using "mailto:" Using the "mailto:" protocol is the only way to send form information without a server script. A "mailto" compatible form is nothing more than a form where the "action" attribute points to the recipient of the mail. By default the "mailto" protocol sends data as one long line. This method of processing form data should be avoided because functionality is not consistent in all browsers.

<button> tag You can also use the <button> tag to create your own image buttons and your own graphics. <button type="submit" name="submit" value="submit"> <img src="images/continue.jpg" alt="continue" align="center" /> </button> <button type="reset" name="reset" value="reset"> <img src="images/reset.jpg" alt="reset" align="center" /> </button>