HTML Forms. Pat Morin COMP 2405



Similar documents
Internet Technologies

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

Further web design: HTML forms

HTML Forms and CONTROLS

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

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

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

PHP Form Handling. Prof. Jim Whitehead CMPS 183 Spring 2006 May 3, 2006

Web Development 1 A4 Project Description Web Architecture

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

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

Web Development. Owen Sacco. ICS2205/ICS2230 Web Intelligence

Introduction to XHTML. 2010, Robert K. Moniot 1

FORM-ORIENTED DATA ENTRY

HTML Tables. IT 3203 Introduction to Web Development

CS412 Interactive Lab Creating a Simple Web Form

CGI Programming. What is CGI?

Viewing Form Results

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

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

Inspiring Creative Fun Ysbrydoledig Creadigol Hwyl. Web Design in Nvu Workbook 1

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

JavaScript and Dreamweaver Examples

Manual for CKForms component Release 1.3.4

Dreamweaver Tutorials Creating a Web Contact Form

A MODEL FOR THE AUTOMATION OF HTML FORM CREATION AND VALIDATION. Keywords: html, form, web, automation, validation, class, model.

Using Form Tools (admin)

FORMS. Introduction. Form Basics

MHC Drupal User Manual: Webforms

Introduction to Web Design Curriculum Sample

Designing and Implementing Forms 34

MONAHRQ Installation Permissions Guide. Version 2.0.4

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

Website Planning Checklist

Fountas & Pinnell Online Data Management System. Manage. Main Navigation Manage Districts/Schools/Classes Manage Groups Manage Students Manage Account

FrontPage 2003: Forms

Working with forms in PHP

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

Objectives. Understand databases Create a database Create a table in Datasheet view Create a table in Design view

User Guide for Smart Former Gold (v. 1.0) by IToris Inc. team

Introduction Designing your Common Template Designing your Shop Top Page Product Page Design Featured Products...

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

Getting Started with Access 2007

c. Write a JavaScript statement to print out as an alert box the value of the third Radio button (whether or not selected) in the second form.

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

Form Management Admin Guide

Norwex Office Suite: The Consultant Experience

JOOMLA 2.5 MANUAL WEBSITEDESIGN.CO.ZA

VDF Query User Manual

Configuring Custom Fields in JEvents Club Addon

CREATING WEB FORMS WEB and FORMS FRAMES AND

Accessibility in e-learning. Accessible Content Authoring Practices

Gravity Forms: Creating a Form

The Smart Forms Web Part allows you to quickly add new forms to SharePoint pages, here s how:

Working with Access Tables A Continuation

Getting Started with. Venue & Vendor Guide. Page 1

How to Schedule Report Execution and Mailing

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

Bonita Open Solution. Introduction Tutorial. Version 5.7. Application Development User Guidance Profile: Application Developer

Tutorial: Creating a form that s the results to you.

Rochester Institute of Technology. Finance and Administration. Drupal 7 Training Documentation

Application Developer Guide

To change title of module, click on settings

Fast track to HTML & CSS 101 (Web Design)

Sage CRM. Sage CRM 2016 R1 Mail Merge Datasheet

UNIVERSITY OF CALGARY Information Technologies WEBFORMS DRUPAL 7 WEB CONTENT MANAGEMENT

Form Tutorial. Overview. Creating a Form. Insert a Form

Integrated Research Application System (IRAS)

FRONTPAGE FORMS

Help Desk User Manual (Version 1.0)

Teacher References archived classes and resources

Salesforce Integration Version 1.2, published 15/04/ :45

Turn editing on and under Add an Activity use the drop down list and click on Questionnaire.

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

Garfield Public Schools Fine & Practical Arts Curriculum Web Design

Building A Very Simple Web Site

Broker Portal Tutorial Broker Portal Basics

Caldes CM12: Content Management Software Introduction v1.9

ORACLE BUSINESS INTELLIGENCE WORKSHOP

Departmental User Dashboard

Forms, CGI Objectives. HTML forms. Form example. Form example...

MS Outlook 2002/2003. V1.0 BullsEye Telecom

System Administration and Log Management

Central Commissioning Facility Research Management Systems (RMS): User Guidance

User s Guide For Department of Facility Services

Getting Started with KompoZer

Terminal Four. Content Management System. Moderator Access

Creating Connection with Hive

BF Survey Plus User Guide

How To Connect Your Transactions To Quickbooks Online From Your Bank Or Credit Card Account On A Pc Or Mac Computer Or Ipa Device

REGISTER OF COMPANIES, ENTERPRISES AND BUSINESS

Implementing Specialized Data Capture Applications with InVision Development Tools (Part 2)

Transcription:

HTML Forms Pat Morin COMP 2405

HTML Forms An HTML form is a section of a document containing normal content plus some controls Checkboxes, radio buttons, menus, text fields, etc Every form in a document is contained in a FORM tag The FORM tag specifies the action that takes place when the form is submitted 2

The FORM Tag The FORM tag has two important attributes: ACTION A URI specifying where the information is sent METHOD How the data is sent (GET or POST) <form action="http://myserver.com/cgi-bin/test-cgi.pl" method="get"> <p>enter your name: <input type="text" name="yname" value="your Name Here" maxlength="50"> </p> <input type="submit"> </form> 3

GET or POST Forms should use METHOD="GET" when the form does not modify anything on the server: A search engine query A database search Forms should use METHOD="POST" when the form changes the state of the server or sends a large amount of data Entering a message on a forum Uploading a file GET and POST transport the form data in different ways 4

Controls The devices that allow input of data onto a form are called the controls These include Checkboxes and radio buttons Menus Text inputs File selectors Hidden controls Buttons 5

The INPUT Tag The INPUT tag is a multipurpose tag that creates many different types of controls The type of input is controlled by the TYPE attribute Can be TEXT, PASSWORD, CHECKBOX, RADIO, SUBMIT, RESET, FILE, HIDDEN, IMAGE, or BUTTON Almost all of these should have a NAME attribute Their initial state can be set with a VALUE attribute They can all be disabled with DISABLE An INPUT tag is never closed (no </input>) 6

Checkboxes <input type="checkbox"...> The NAME attribute names this checkbox The CHECKED attribute (with no value) is used to indicate a pre-checked checkbox The VALUE attribute specifies the value bound to name if this checkbox is submitted (default = ON) Check all that apply:<br> <input type="checkbox" name="dogs">i like dogs<br> <input type="checkbox" name="cats">i like cats<br> <input type="checkbox" name="pigs">i like pigs 7

Radio Boxes <input type="radio"...> Used when user is to select one of many mutually exclusive options Radio buttons with same name form a group of mutually exclusive options Select <em>one of</em> the following:<br> <input type="radio" name="agree" checked value="a">i agree completely<br> <input type="radio" name="agree" value="b">i agree a little<br> <input type="radio" name="agree" value="c">i disagree a little<br> <input type="radio" name="agree" value="d">i disagree completely<br> 8

Text Boxes <input type="text"...> Allows entry of one line of text (Actually, not completely true try cut and paste) Attribute SIZE specifies the width (in characters) Attribute MAXLENGTH specifies the maximum number of characters User's full name: <input name="fullname" type="text" size="30" maxlength="50"> 9

Passwords <input type="password"...> Identical to a text box, but text typed into the box is not readable Useful for submitting sensitive information (like passwords) 10

Buttons <input type="submit"...> Creates a button that submits the form to the server <input type="reset"...> Creates a button that resets all form fields to their default state <input type="button"...> Creates a button that does nothing <input type="submit" value="submit Form Data"> 11

Buttons (2) The BUTTON tag provides similar functionality but with a bit more flexibility Attributes are NAME, VALUE, and TYPE TYPE can be SUBMIT, BUTTON, RESET <button name="sb" value="sbdata" type="submit"> Submit All Form Data Now </button> Main difference is that the button label is text within the tag instead of the VALUE attribute 12

Image Buttons <input type="image"...> Displays an image that behaves like a submit button The SRC attribute specifies the location of an image file The ALT attribute specifies some text to render if the image is not displayable <input type="image" src="button.png" alt="submit"> 13

Hidden Control <input type="hidden"...> Creates a control similar to a text control User does not see control User can not easily change the value Useful for keeping track of data as the user traverses a collection of pages <input type="hidden" name="hiddendata" value="hidden Data in Here"> 14

Text Areas The TEXTAREA tag provides a multiline text entry area The ROWS and COLS attributes are required and they specify the number of rows and number of columns <textarea rows="30" cols="50" name="bigtext"> The preformatted initial text is sandwiched within the tag. </textarea> 15

Menus Drop-down menus are created using the SELECT tag Attribute SIZE determines how many rows to display at once Each option is enclosed in an OPTION tag <select name="country" size="5"> <option value="ab">abkhazia</option>... <option value="zb">zimbabwe</option> </select> 16

Menus (Cont'd) The MULTIPLE attribute of the SELECT tag creates menus that allow multiple selections Options can be grouped hierarchically using the OPTGROUP tag 17

Labels The LABEL tag specifies that the enclosed item is a label for the named form element For example, clicking the label will shift the focus or change the state of the associated form Check all that apply<br> <input type="checkbox" name="doglover" id="dogs" checked> <label for="dogs">i like dogs</label> <br> <input type="checkbox" name="catlover" id="cats"> <label for="cats">i like cats</label> <br> <input type="checkbox" name="piglover" id="pigs"> <label for="pigs">i like pigs</label> element 18

Fieldsets The FIELDSET tag is used to group together a set of related form elements The LEGEND tag assigns a caption to a field set <fieldset> <legend>personal Information</legend> First Name: <input type="text" name="fn" size="20"> <br> Last Name: <input type="text" name="ln" size="20"> <br> Date of Birth: <input type="text" name="dob" size="10"> </fieldset> 19

Summary HTML forms allow users to input data that is submitted to a web server Many types of controls are possible Other options File selection (for upload) Tabbing navigation (TABINDEX attribute) Access keys (ACCESSKEY attribute) Disabled and read-only controls For more information and options, see http://www.w3.org/tr/html4/interact/forms.html 20