Client-Side Internet and Web Programming

Slides:



Advertisements
Similar presentations
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.
Advertisements

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.
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.
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?
1 XHTML Forms A form is the mechanism to –Collect information from a browser user –Transmit collected information from a browser to a server HTML/XHTML.
Robinson_CIS_285_2005 HTML FORMS CIS 285 Winter_2005 Instructor: Mary Robinson.
CSC 2720 Building Web Applications HTML Forms. Introduction  HTML forms are used to collect user input.  The collected input is typically sent to a.
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
HTML Forms.
LOGO FORMs in HTML CHAPTER 5 Eastern Mediterranean University School of Computing and Technology Department of Information Technology ITEC229 Client-Side.
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.
1 Form Elements  Form elements have properties: Text boxes, Password boxes, Checkboxes, Option(Radio) buttons, Submit, Reset, File, Hidden and Image.
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.
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.
HTLM Forms CS3505. Form Handling in Browser html User Files out form WEbBROWSErWEbBROWSEr User read response submit Get URL?input html Get file html script.
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.
Week 10: HTML Forms HNDIT11062 – Web Development.
Creating Forms on a Web Page. 2 Introduction  Forms allow Web developers to collect visitor feedback  Forms create an environment that invites people.
Copyright (c) 2004 Prentice-Hall. All rights reserved. 1 Committed to Shaping the Next Generation of IT Experts. Project 6: Creating XHTML Forms Kelly.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
Web Forms. Web Forms: A form allows our web visitors to submit information to us. Some examples uses for forms are to let the web user contact us, fill.
HTML FORM. Form HTML Forms are used to select different kinds of user input. HTML forms are used to pass data to a server. A form can contain input elements.
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
Web Development Part 2.
How to Write Web Forms By Mimi Opkins.
CS3220 Web and Internet Programming HTML Tables and Forms
Forms Web Design Ms. Olifer.
HTML Forms Pat Morin COMP 2405.
FORMS IN HTML.
>> More on HTML Forms
Introduction to Web programming
FORMS Explained By: Sarbjit Kaur.
ITE 115 Creating Web Page Forms
Basic XHTML Tables XHTML tables—a frequently used feature that organizes data into rows and columns. Tables are defined with the table element. Table.
Client-Side Internet and Web Programming
ARUSHA TECHNICAL COLLEGE WEB DESIGN(html forms)
Designing Forms Lesson 10.
1.5 FORMS.
HTML: Basic Tags & Form Tags
Introduction to Web programming
Creating Form Elements
Web Development & Design Foundations with H T M L 5
Forms Data Entry and Capture
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.
CS3220 Web and Internet Programming HTML Tables and Forms
HTML Forms Internet Technology.
HTML Forms Internet Technology.
Principles of Web Design 5th Edition
Creating Forms on a Web Page
Intro to Forms HTML forms are used to gather information from end-users. A form can contain elements like radio-buttons, text fields, checkboxes, submit.
Intro to Forms HTML forms are used to gather information from end-users. A form can contain elements like radio-buttons, text fields, checkboxes, submit.
© Hugh McCabe 2000 Web Authoring Lecture 8
HTML Forms
Making your HTML Page Interactive
Unit 5 Create Forms.
HTML: Basic Tags & Form Tags
Presentation transcript:

Client-Side Internet and Web Programming Eastern Mediterranean University School of Computing and Technology Department of Information Technology ITEC229 Client-Side Internet and Web Programming FORMs in HTML CHAPTER 5 Prepared by: R. Kansoy

5. FORMs in HTML Used to collect information from people viewing your site The <FORM> </FORM> tag is used to create an HTML form. FORM element Attributes METHOD attribute indicates the way the Web server will organize and send you form output. • METHOD = “post” in a form that causes changes to server data. • METHOD = “get” in a form that does not cause any changes in server data. ACTION attribute • Path to a script Web server: machine that processes browser requests. http://sct.emu.edu.tr/it/itec229

5. FORMs in HTML HTML forms are used to pass data to a server. A form can contain input elements like; text fields, checkboxes, radio buttons, submit buttons and more.. A form can also contain select lists, textarea, fieldset, legend, and label elements. http://sct.emu.edu.tr/it/itec229

5. FORMs in HTML The Input Element The most important form element is the input element. An input element can vary in many ways, depending on the type attribute. An input element can be of type text, checkbox, password, radio, submit, reset and more.. http://sct.emu.edu.tr/it/itec229

5. FORMs in HTML The Input Element INPUT element Attributes: TYPE (required) – Defines the usage of the INPUT element – Hidden inputs always have TYPE = “hidden” NAME provides a unique identification for INPUT element VALUE indicates the value that the INPUT element sends to the server upon submission SIZE – For TYPE = “text”, specifies the width of the text input, measured in characters MAXLENGTH – For TYPE = “text”, specifies the maximum number of characters that the text input will accept http://sct.emu.edu.tr/it/itec229

5. FORMs in HTML Text Fields <input type="text"> defines a one-line input field that a user can enter text into: <form> First name: <input type="text" name="fname" size="25"> <br> Last name: <input type="text" name="lname" size="25"> </form> How the HTML code above looks in a browser: Note: The form itself is not visible. Also note that the default width of a text field is 25 characters.  http://sct.emu.edu.tr/it/itec229

5. FORMs in HTML Password Field <input type="password"> defines a password field: <form> Password: <input type="password" name="pswd"> </form> How the HTML code above looks in a browser: Note: The characters in a password field are masked (shown as asterisks or circles).  http://sct.emu.edu.tr/it/itec229

5. FORMs in HTML Radio Buttons Radio buttons let a user select ONLY ONE of a limited number of choices. <input type="radio"> defines a radio button. CHECKED attribute indicates which radio button is selected initially <form> <input type="radio" name="gender" value="male">Male<br> <input type="radio" name="gender" value="female">Female </form> How the HTML code above looks in a browser: http://sct.emu.edu.tr/it/itec229

5. FORMs in HTML Checkboxes Checkboxes let a user select NONE/ONE/MORE options of a limited number of choices. <input type="checkbox"> defines a checkbox. Used individually or in groups Each checkbox in a group should have same NAME Make sure that the checkboxes within a group have different VALUE attribute values Otherwise, browser will cannot distinguish between them CHECKED attribute checks boxes initially http://sct.emu.edu.tr/it/itec229

5. FORMs in HTML Checkboxes <form> <input type="checkbox" name="vehicle" value="Bike"> I have a bike<br> <input type="checkbox" name="vehicle" value="Car"> I have a car  </form> How the HTML code above looks in a browser: http://sct.emu.edu.tr/it/itec229

5. FORMs in HTML Submit Button <input type="submit"> defines a submit button. A submit button is used to send form data to a server. The data is sent to the page specified in the form's action attribute. The file defined in the action attribute usually does something with the received input. VALUE attribute changes the text displayed on the button (default is “Submit”) <form name="input" action="html_form_action.asp" method="get"> Username: <input type="text" name="user"> <input type="submit" value="Submit"></form> How the HTML code above looks in a browser: NOTE: If you type some characters in the text field above, and click the "Submit" button, the browser will send your input to a page called "html_form_action.asp". The page will show you the received input http://sct.emu.edu.tr/it/itec229

5. FORMs in HTML Reset Button <input type= "reset" > defines a reset button. A reset button is used to clear all the entries user entered into the form. VALUE attribute changes the text displayed on the button (default is “Reset”) <form name="input" action="html_form_action.asp" method="get"> <P>Username: <input type="text" name="user" size="25"></P> <P>Password: <input type="password" name="pswd" size="25"></P> <P><input type="submit" value="Submit"> <input type="reset" value="Reset"></P></form> How the HTML code above looks in a browser: http://sct.emu.edu.tr/it/itec229

5. FORMs in HTML TEXTAREA Inserts a scrollable text box into FORM ROWS and COLS attributes specify the number of character rows and columns <form name="input" action="html_form_action.asp" method="get"> <textarea rows="6" cols="36"> ITEC 229 </textarea> </form> How the HTML code above looks in a browser: http://sct.emu.edu.tr/it/itec229

5. FORMs in HTML SELECT Places a selectable list of items inside FORM Include NAME attribute Add an item to list Insert an OPTION element in the <SELECT>…</SELECT>tags Closing OPTION tag optional SELECTED attribute applies a default selection to list Change the number of list options visible Including the SIZE = “x” attribute inside the <SELECT> tag x number of options visible http://sct.emu.edu.tr/it/itec229

5. FORMs in HTML SELECT How the HTML code above looks in a browser: <form action=""> <select name="cars"> <option selected>BMW</option> <option>Mercedes</option> <option>Audi</option> </select> </form> How the HTML code above looks in a browser: http://sct.emu.edu.tr/it/itec229

5. FORMs in HTML EXAMPLE 1: <HTML> <HEAD><TITLE> Forms</TITLE></HEAD> <BODY> <H2>Feedback Form</H2> <P>Please fill out this form to help us improve our site.</P> <FORM METHOD = "POST" ACTION = "/cgi-bin/formmail"> <INPUT TYPE = "hidden" NAME = "recipient" VALUE = "deitel@deitel.com"> <INPUT TYPE = "hidden" NAME = "subject" VALUE = "Feedback Form"> <INPUT TYPE = "hidden" NAME = "redirect" VALUE = "main.html"> <P><STRONG>Name: </STRONG> <INPUT NAME = "name" TYPE = "text" SIZE = "25"></P> <P><STRONG>Comments:</STRONG> <TEXTAREA NAME = "comments" ROWS = "4" COLS = "36"></TEXTAREA> </P> http://sct.emu.edu.tr/it/itec229

5. FORMs in HTML EXAMPLE 1 (cont..) : <P><STRONG>Email Address:</STRONG> <INPUT NAME = "email" TYPE = "text" SIZE = "25"></P> <P><STRONG>Things you liked:</STRONG><BR> Site design <INPUT NAME="things" TYPE="checkbox" VALUE="Design"> Links <INPUT NAME="things" TYPE="checkbox" VALUE="Links"> Ease of use <INPUT NAME="things" TYPE="checkbox" VALUE="Ease"> Images <INPUT NAME="things" TYPE="checkbox" VALUE="Images"> Source code <INPUT NAME="things" TYPE="checkbox" VALUE="Code"> </P> <INPUT TYPE="submit" VALUE="Submit Your Entries"> <INPUT TYPE="reset" VALUE="Clear Your Entries"> </FORM> </BODY> </HTML> http://sct.emu.edu.tr/it/itec229

5. FORMs in HTML EXAMPLE 1 (output): http://sct.emu.edu.tr/it/itec229

5. FORMs in HTML EXAMPLE 2: <HTML> <HEAD><TITLE> Forms II</TITLE></HEAD> <BODY> <H2>Feedback Form</H2> <P>Please fill out this form to help us improve our site.</P> <FORM METHOD = "POST" ACTION = "/cgi-bin/formmail"> <INPUT TYPE = "hidden" NAME = "recipient" VALUE = "deitel@deitel.com"> <INPUT TYPE = "hidden" NAME = "subject" VALUE = "Feedback Form"> <INPUT TYPE = "hidden" NAME = "redirect" VALUE = "main.html"> <P><STRONG>Name: </STRONG> <INPUT NAME = "name" TYPE = "text" SIZE = "25"></P> <P><STRONG>Comments:</STRONG> <TEXTAREA NAME = "comments" ROWS = "4" COLS = "36"></TEXTAREA> </P> <P><STRONG>Email Address:</STRONG> <INPUT NAME = "email" TYPE = "password" SIZE = "25"></P> http://sct.emu.edu.tr/it/itec229

5. FORMs in HTML EXAMPLE 2 (cont..): <P><STRONG>Things you liked:</STRONG><BR> Site design <INPUT NAME="things" TYPE="checkbox" VALUE="Design"> Links <INPUT NAME="things" TYPE="checkbox" VALUE="Links"> Ease of use <INPUT NAME="things" TYPE="checkbox" VALUE="Ease"> Images <INPUT NAME="things" TYPE="checkbox" VALUE="Images"> Source code <INPUT NAME="things" TYPE="checkbox" VALUE="Code"></P> <P><STRONG>How did you get to our site?:</STRONG><BR> Search engine <INPUT NAME="how get to site" TYPE="radio" VALUE="search engine" CHECKED> Links from another site <INPUT NAME="how get to site" TYPE="radio" VALUE="link"> Deitel.com Web site <INPUT NAME="how get to site" TYPE="radio" VALUE="deitel.com"> Reference in a book <INPUT NAME="how get to site" TYPE="radio" VALUE="book"> Other <INPUT NAME="how get to site" TYPE="radio" VALUE="other"></P> http://sct.emu.edu.tr/it/itec229

5. FORMs in HTML EXAMPLE 2 (cont..): <P><STRONG>Rate our site (1-10):</STRONG> <SELECT NAME = "rating"> <OPTION SELECTED>Amazing:-) <OPTION>10 <OPTION>9 <OPTION>8 <OPTION>7 <OPTION>6 <OPTION>5 <OPTION>4 <OPTION>3 <OPTION>2 <OPTION>1 <OPTION>The Pits:-( </SELECT></P> <INPUT TYPE = "submit" VALUE = "Submit Your Entries"> <INPUT TYPE = "reset" VALUE = "Clear Your Entries"> </FORM> </BODY> </HTML> http://sct.emu.edu.tr/it/itec229

5. FORMs in HTML EXAMPLE 2 (output): http://sct.emu.edu.tr/it/itec229

Thank You ! END of CHAPTER 5 FORMs in HTML http://sct.emu.edu.tr/it/itec229