FORMS IN HTML.

Slides:



Advertisements
Similar presentations
>> Introduction to HTML: Forms. Introduction to HTML 5 Important HTML Tags HTML tags and attributes Images Hyperlinks Lists –{ordered | unordered | definition}
Advertisements

Creating Web Page Forms. Objectives Describe how Web forms can interact with a server-based program Insert a form into a Web page Create and format a.
Forms Review. 2 Using Forms tag  Contains the form elements on a web page  Container tag tag  Configures a variety of form elements including text.
XHTML Forms for Data Collection and Submission Chapter 5.
ECA 228 Internet/Intranet Design I Forms. ECA 228 Internet/Intranet Design I Forms forms are a way for a user to communicate with you – text fields –
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
Chapter 10 Form Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
Tutorial #9 – Creating Forms. Tutorial #8 Review – Tables Borders (table, gridlines), Border-collapse: collapse; empty-cells: show; and rowspan, colspan.
4-Sep-15 HTML Forms Mrs. Goins Web Design Class. Parts of a Web Form A Form is an area that can contain Form Control/Elements. Each piece of information.
XP Tutorial 6New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Creating Web Page Forms Designing a Product Registration Form Tutorial.
Forms and Form Controls Chapter What is a Form?
CSC 2720 Building Web Applications HTML Forms. Introduction  HTML forms are used to collect user input.  The collected input is typically sent to a.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 9 Key Concepts 1 Copyright © Terry Felke-Morris.
 Whether using paper forms or forms on the web, forms are used for gathering information. User enter information into designated areas, or fields. Forms.
HTML Forms.
LOGO FORMs in HTML CHAPTER 5 Eastern Mediterranean University School of Computing and Technology Department of Information Technology ITEC229 Client-Side.
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
Week 9 - Form Basics Key Concepts 1. 1.Describe common uses of forms on web pages 2.Create forms on web pages using the form, input, textarea, and select.
Creating Web Page Forms. Introducing Web Forms Web forms collect information from users Web forms include different control elements including: –Input.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 9 Key Concepts 1 Copyright © Terry Felke-Morris.
FORMS. Forms are used to receive information from the web surfer, such as: their name, address, credit card, etc. Form fields are objects that allow.
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
1 Review of Form Elements. 2 The tag Used in between tags.  Form elements(text control, buttons, etc.. ) goes here. OR  Form elements(text control,
HTML Forms a form is a container for input elements on a web page input elements contain data that is sent to the web server for processing.
SYST Web Technologies SYST Web Technologies XHTML Forms.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 9 Key Concepts 1 Copyright © Terry Felke-Morris.
+ FORMS HTML forms are used to pass data to a server. begins and ends a form Forms are made up of input elements Every input element has a name and value.
Project 6 Creating Forms on a Web Page. Objectives Define terms related to forms Describe the different form controls and their uses Use the tag Create.
HTML Creating Forms on a Web Page. 2 Objectives  Discuss the process of creating a form  Distinguish between data input controls and text input controls.
HTML Forms.
Chapter 9 Quick Links Slide 2 Performance Objectives Understanding Forms Planning Forms Creating Forms Creating Text Fields Creating Hidden Fields Creating.
Lesson 5 Introduction to HTML Forms. Lesson 5 Forms A form is an area that can contain form elements. Form elements are elements that allow the user to.
HTML Structure II (Form) WEEK 2.2. Contents Table Form.
Ashima Wadhwa Java Script And Forms. Introduction Forms: –One of the most common Web page elements used with JavaScript –Typical forms you may encounter.
XP Tutorial 6New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Creating Web Page Forms Designing a Product Registration Form Tutorial 6.
2440: 141 Web Site Administration Web Forms Instructor: Joseph Nattey.
Tutorial 6 Working with Web Forms
Creating and Processing Web Forms
Client-Side Internet and Web Programming
Making your HTML Page Interactive
PHP: Forms FdSc Module 109 Server side scripting and Database design
How to Write Web Forms By Mimi Opkins.
Introduction to HTML Forms and Servlets
Objectives Design a form Create a form Create text fields
HTML Forms Pat Morin COMP 2405.
>> More on HTML Forms
(and available form fields)
FORMS Explained By: Sarbjit Kaur.
ITE 115 Creating Web Page Forms
Getting User Input with Forms
Lesson 8 Week 8 Designing Forms
ARUSHA TECHNICAL COLLEGE WEB DESIGN(html forms)
Designing Forms Lesson 10.
Introducing Forms.
1.5 FORMS.
HTML: Basic Tags & Form Tags
Creating Form Elements
Creating Form Elements
Web Development & Design Foundations with H T M L 5
FORM OBJECT When creating an interactive web site for the Internet it is necessary to capture user input and process this input. Based on the result of.
CNIT 131 HTML5 - Forms.
Web Development & Design Foundations with H T M L 5
Creating Forms on a Web Page
Basics of Web Design Chapter 10 Form Basics Key Concepts
© Hugh McCabe 2000 Web Authoring Lecture 8
Making your HTML Page Interactive
Unit 5 Create Forms.
HTML: Basic Tags & Form Tags
Presentation transcript:

FORMS IN HTML

Forms An HTML form provides data gathering functionality to a web page. Html provides the <form>…</form> tags with which an html form can be created to capture user input. Input tag: defines an input area within a form. The different ways of input are specified by “type” attribute. This attribute can accept text, radio, checkbox, password submit, reset, image, hidden etc as its value.

TEXT FIELDS It presents the user with a prompt for a single line of text. These fields are commonly used for a name address, email address, country, postal code etc. <input type=“text” name=“text-id” value=“default-text” size=“n” maxlegth=“m” read only> Name: to label the content. This name is not visible to the user and must be unique within the form. Value: to supply initial text to the txt field and is optional. The content of this attribute will be shown on the text field, unless the user changes it. Size: to specify the physical size of the text input box. The default value is usually a length of 20 characters.

Maxlength: to set the number of character a user can input Maxlength: to set the number of character a user can input. The default value of max length is unlimited. Readonly: to lock the predefined content within the text field and the content won’t be editable further. <html> <head><title>form</title></head> <body> <p align="center"> <b> ADMISSION FORM</b> <form> <p> NAME:       <input type="text" name="name" value="enter your name here" size=25 maxlength=30> <br><br> ADDRESS: <input type="text" name="address" value="enter your address here" size=25 maxlength=30><br><br> </form> </body> </html>

Password Password fields are similar to the text fields, except the content of the field are not visible on the screen. It displays **** instead of the actual input. <input type=“password” name=“password-id” value=“default-text” size=“n” maxlength=“m” readonly>

Radio Buttons These are mutually exclusive i.e. they allow the user to choose one of the several options. Selecting one turns the other off. These buttons are viewed in the browser as small circles with a prompt and the selected one appears with a solid dot in it. <input type=“radio” name=“radio-id” value=“choice-id” checked> Value: it is the value assigned by the user. Each radio button must be assigned a value. Checked: causes the radio button to be on when the form is first created.

Checkboxes An input tag with attribute type=“checkbox” offers the user an “on” or “off” switch.Each check box works independently from the other, visitor can select or deselect any combination of checkboxes. Use of these boxes are appropriate where user can have more than one right answer. <input type=“checkbox” name=“box-id” value=“choice-id” checked>

Drop down list A pull down menu lets the user select one choice out of many possible choices. All choices are not visible on screen, they are hidden. They occupy minimal amount of space. <select name=“text-id” size=“n” multiple> <option value=“choice-id1” selected>text-label1</option> <option value=“choice-id2” selected>text-label2</option> <option value=“choice-id3” selected>text-label3</option> </select> Size: no. of items to be displaced at a time. Selected: this value will be selected when 1st time page appears.

TEXTAREA This tag is used to set an area within a form in which the user can type a large amount of text. This is basically used for giving comments and free form feedback from visitor <textarea name=“text-id” rows=“n” cols=“m” wrap=“virtual|physically|off” read only>INITIAL TEXT</text area> Rows: specifies the height of the text area. Cols: this attribute specifies the width of the text area. Wrap: if option is off then text is handled as one long sequence of text without line breaks. If its virtual the text appears on page as if its recognized line breaks but when the form is submitted the line breaks are turned off. If its set to physical then line breaks are included. Readonly: it prevents the user to alter the initial content.

Reset and submit buttons Submit: submits the information to the URL given as the action attribute of the form tag. <input type=“submit” value=“button-label”>. Image can also be used for submit button. <input type=image src=path heigth=n width=m alt=text border=0> Reset: clears the form enteries to the default one or leaves them blank if no default values are specified. <input type=“reset” value=“button-label”>.

FILES To allow visitor to upload files. <input type=file name=field-id size=n > Size: to specify the physical size of the field’s input box.

HIDDEN VALUES They do not appear in the displayed form. By setting the “type” attribute to hidden, it is possible to transmit default or previously specified text that is hidden from the user to the handling program. <input type=hidden name=data-id value=“hidden form data”>

Fieldset and legend tags <fieldset> tag creates a box around a group of widgets and <legend> tag provides a label to the field set. Both tags require closing tag. <body> <fieldset> <legend><H2>DETAILS</H2></legend> <form> …. </form> </fieldset> </body>

NAVIGATING THOUGH A FORM By default, we navigate through the form in order on which elements appear in the form, using the tabindex attribute we can change this default order. Access keys: provide keyboard access to the form using accesskey attribute

<body> <p align="center"> <b> ADMISSION FORM</b> <fieldset> <legend><b>DETAILS</legend> <form> <p> NAME:       &nbs p; <input type="text" name="name" value="enter your name here" size=25 maxlength=30 readonly> <br><br> ADDRESS:   <input type="text" name="address" value="enter your address here" size=25 maxlength=30><br><br> PASSWORD:<input type="password" name="password-id" value="" size=25 maxlength=30><br><br> GENDER: <input type="radio" name="gender" value="male" checked> male <input type="radio" name="gender" value="female" >female<br><br> OWN VEHICLE: <input type ="checkbox" name="vehicle" value="vehicle" checked><br><br> HOSTEL REQUIRED: <input type ="checkbox" name="hostel" value="hostel" ><br><br> COUNTRY: <select name="country" size=2 multiple> <option value="india" selected>INDIA <option value="america">AMERICA <option value="australia">AUSTRALIA <option value="new zealand">NEW ZEALAND <option value="china">CHINA </select><br><br> COMMENTS: <textarea name=“comments” rows=“10” cols=“10” wrap=“physical” >place your text here</textarea><br><br> ATTACHMENTS:<input type=file name=file-name size=10> <br><br> <input type=hidden name=hidden-box value=“hidden form data”> <input type="submit" value="DONE"><input type="reset" value="CLEAR"> <br> <input type=image src=sunset.jpg heigth=100 width=100 alt="text" border=1> </form> </fieldset> </body>