LIS651 lecture 0 forms Thomas Krichel 2010-01-21.

Slides:



Advertisements
Similar presentations
LIS651 lecture 0 Gathering and showing data Thomas Krichel
Advertisements

LIS651 lecture 0 Gathering and showing data Thomas Krichel
HTML Forms. collect information for passing to server- side processes built up from standard widgets –text-input, radio buttons, check boxes, option lists,
WEB DESIGN TABLES, PAGE LAYOUT AND FORMS. Page Layout Page Layout is an important part of web design Why do you think your page layout is important?
23-Aug-14 HTML/XHTML Forms. 2 What are forms? is just another kind of XHTML/HTML tag Forms are used to create (rather primitive) GUIs on Web pages Usually.
Lecture 14 HTML Forms CPE 401 / 601 Computer Network Systems slides are modified from Dave Hollinger.
Supplement Creating Forms. Objectives Show how forms are used How to create the Form element HTML elements used for creating input fields.
HTML and XHTML Controlling the Display Of Web Content.
JavaScript Forms Form Validation Cookies CGI Programs.
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.
Tutorial 6 Working with Web Forms
Form Basics CS Web Data  Most interesting web pages revolve around data  examples: Google, IMDB, Digg, Facebook, YouTube, Rotten Tomatoes  can.
USER INTERACTIONS: FORMS
Tutorial 6 Working with Web Forms. XP Objectives Explore how Web forms interact with Web servers Create form elements Create field sets and legends Create.
Creating Web Page Forms
Tutorial 6 Forms Section A - Working with Forms in JavaScript.
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 –
Forms, Validation Week 7 INFM 603. Announcements Try placing today’s example in htdocs (XAMPP). This will allow you to execute examples that rely on PHP.
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
Chapter 9 Collecting Data with Forms. A form on a web page consists of form objects such as text boxes or radio buttons into which users type information.
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
Reading Data in Web Pages tMyn1 Reading Data in Web Pages A very common application of PHP is to have an HTML form gather information from a website's.
XP Tutorial 6New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Creating Web Page Forms Designing a Product Registration Form Tutorial.
XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 1 Creating Web Page Forms Designing a Product Registration Form Tutorial 6.
CO1552 Web Application Development HTML Forms. Websites can be made more interactive by providing facilities for users to provide data To get user entered.
1 Creating Web Forms in HTML Web forms collect information from customers Web forms include different control elements including: –Input boxes –Selection.
Forms and Form Controls Chapter What is a Form?
1 Forms A form is the usual way that information is gotten from a browser to a server –HTML has tags to create a collection of objects that implement this.
Chapter 6: Forms JavaScript - Introductory. Previewing the Product Registration Form.
XHTML Introductory1 Forms Chapter 7. XHTML Introductory2 Objectives In this chapter, you will: Study elements Learn about input fields Use the element.
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.
JavaScript, Fourth Edition Chapter 5 Validating Form Data with JavaScript.
Chapter 8 Collecting Data with Forms. Chapter 8 Lessons Introduction 1.Plan and create a form 2.Edit and format a form 3.Work with form objects 4.Test.
Website Development with PHP and MySQL Saving Data.
CpSc 462/662: Database Management Systems (DBMS) (TEXNH Approach) HTML Forms James Wang.
HTML Forms.
LOGO FORMs in HTML CHAPTER 5 Eastern Mediterranean University School of Computing and Technology Department of Information Technology ITEC229 Client-Side.
1 © Netskills Quality Internet Training, University of Newcastle HTML Forms © Netskills, Quality Internet Training, University of Newcastle Netskills is.
ITCS373: Internet Technology Lecture 5: More HTML.
XHTML & Forms. PHP and the WWW PHP and HTML forms – Forms are the main way users can interact with your PHP scrip Typical usage of the form tag in HTML.
LIS651 lecture 0 collecting and showing data Thomas Krichel
Tutorial 6 Working with Web Forms. XP Objectives Explore how Web forms interact with Web servers Create form elements Create field sets and legends Create.
Tutorial 6 Working with Web Forms. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Explore how Web forms interact with.
LIS651 lecture 0 Gathering and showing data Angela Cornwell, Thomas Krichel
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.
Forms Collecting Data CSS Class 5. Forms Create a form Add text box Add labels Add check boxes and radio buttons Build a drop-down list Group drop-down.
+ 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.
©SoftMooreSlide 1 Introduction to HTML: Forms ©SoftMooreSlide 2 Forms Forms provide a simple mechanism for collecting user data and submitting it to.
Tutorial 6 Working with Web Forms. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Explore how Web forms interact with.
Netprog CGI and Forms1 CGI and Forms A detailed look at HTML forms.
HTML Forms.
Week 10: HTML Forms HNDIT11062 – Web Development.
HTML Forms. A form is simply an area that can contain form fields. Form fields are objects that allow the visitor to enter information - for example text.
COS 125 DAY 17. Agenda  Assignment 7 not finished grading  Assignment 8 posted Due April 9  Capstone progress reports due  Quiz 2 Corrected 2 A’s,
20-753: Fundamentals of Web Programming 1 Lecture 6: Advanced HTML Fundamentals of Web Programming Lecture 6: Advanced HTML.
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.
HTML III (Forms) Robin Burke ECT 270. Outline Where we are in this class Web applications HTML Forms Break Forms lab.
Introduction to Web Site Development Department of Computer Science California State University, Los Angeles Lecture 8: Forms and Controls.
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.
FORMS Explained By: Jasdeep Kaur. Lecturer, Department of Computer Application, PGG.C.G., Sector: 42, Chandigarh.
LIS651 lecture 0 PHP introduction, HTML form, shop Thomas Krichel
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.
How to Write Web Forms By Mimi Opkins.
LIS651 lecture 0 Gathering and showing data
Presentation transcript:

LIS651 lecture 0 forms Thomas Krichel

course resources Course home page is at The course resource page The class mailing list Me. –Send me . Unless you request privacy, I answer to the class mailing list. –Skype me at thomaskrichel. Get skype from skype.com.

Forms Forms are parts of an HTML document that users can fill in. They may include buttons, checkboxes, text areas, file selections. The thing that users fill in are called the controls of the form. Some controls are hidden. Controls are submitted to PHP in the form of variables. Each control in the HTML form becomes a variable in PHP. This is seen later.

forms examples Here is an example in xamples/forms

This element encloses a form. It is a block level element. All form elements (discussed now) should be children of the element. There may be more than one in the HTML page. accepts the core and i18n attributes. And it has some other attributes. Some of these are required.

the action= attribute of It has a required action= attribute. –The value of this attribute is the location of a file that contains the action to execute when the form is submitted. –In our case, this will be the file name of the PHP script that deals with the form on wotan. By default, scripts are executed using return on the browser while a form element has focus, or a special submit button.

method= of admits a method= attribute. This attribute determines the http method by which the form is submitted to the script. There are only two realistic choices –method="get" (default) –method="post" When the form is submitted the http request line that follows will have the method GET or POST. Validation requires lowercase values.

method="get" If you use GET, the form data is transmitted by appending it to the URL of the script. Google's Web search does it that way, for example. There is a standard way to write the data in the URL knows as Common Gateway Interface, CGI. It is of no further interest to us. Advantage: you can bookmark the form. Problem: there is a limit of 1024 chars for the URL, therefore only a limited information can be transmitted in this way.

method="post" If you use post, the user agent sends the form as a POST message to the server. The data is sent in the body of the http request. Thus it can be as long as you want. If you use POST you can set the MIME type of the data with a special attribute enctype=

home grown action I made an action script for the get method at It shows the result of the form submission, formatted as a definition list. On wotan, you can refer to it as "/list_get.php".

more attributes to Here are two more attributes I will list for completeness –accept-charset= says what character sets will be accepted by the form –accept= says what MIME-types can be accepted

the element This creates a text area where you can put a large chunk of text. The contents of contains the initial value. It takes some attributes –name= sets the name of the control that is set. –cols= sets the number of columns in the text area. –rows= sets the number of rows in the text area. also admits the i18n, core and input attributes (discussed now)

input attribute: tabindex= Stupid users use the mouse to fill in form. Smart users use the tab character on the keyboard. It is much quicker. if you set the tabindex= on a in input, you can set the order. The value of the attribute is a number between 0 and The input with a lower number will be dealt with before the one with a higher number.

input attribute: readonly= If you set readonly="readonly" the control can only be read but not set. This means –It can receive focus but cannot be modified by the user. –It is included in tabbing navigation. –It is transmitted to the server for processing. readonly= is not set by default.

input attribute: disabled= If you set disabled="disabled" the control can only be read but not set. This means –it can not receive focus and can not be modified –it is excluded in tabbing –it is not transmitted to the server for processing. disabled= is not set by default.

the form control This element creates a control. Usually a form has several s as well as text that explains the from. is a replaced element. It is a text level element. Despite the fact that it is a child of the, which is block-level, the requires an extra block level parent.

more on admits the core, i18n and the input attributes. It requires a type= attribute. It takes a name= attribute.

the type= attribute of This attribute can only take the following values –textenter text –password enter text, but don't echo on screen –checkboxenter checks on boxes –radiocheck one select –submitpress to submit form –resetreset form –fileupload file (can only be done with POST) –hiddenhidden form data, not shown –imageimage map submission, not covered further –button a button

the name= attribute of This give a name to the control that the users are setting. The script that is found by the action= attribute will identify the controls by name. Therefore every control should have a different name.

control name and PHP variable When the form is passed to the PHP script named with the action= of the the the controls are accessible as PHP variables. If name is the name of the control, and if the method is POST, the control is read as the variable $_POST['name']. If name is the name of the control, and if the method is GET, the control is read as the variable $_GET['name'].

the size= attribute of It lets you set the size of the input field. Note that the size of the field may not limit the input to that size. When the type is text or password the value you give to this field is the number of characters. Otherwise it is the number of pixels.

the maxlength= attribute of This sets the maximum length on the value. Note that this is different from the size of the input field because there is scrolling. If you dont specify a maximum length there is no limit. But it is good security to have a limit.

the value= attribute of This gives the initial value of the. The initial value is shown to the user. value= is optional but should be given for the radio and checkbox type.

the checked= attributes of When the input is of type 'radio', setting the checked= attribute to any value will tell the browser what button is initially set. Of course there can only be one of them. When the input is of type 'checkbox', setting the checked= attribute to 'checked' value will make sure it is checked initially.

the src= attribute of When the input is of type 'image' the src= attribute gives the URL of the image. This is for input using image maps.

creating menus This is done with element. Each element can have a number of elements that contain the options that the user can choose from. also takes the core and i18n attributes, and some others that we see now.

attributes to name= has the name of the control that is set multiple="multiple" allows multiple selections. However, I dont know how they are being transmitted. By default, multiple= is not set. size= sets how many rows of the selection should be displayed at any one time.

selectable choice: Within a there are a series of elements that contain the selections. takes the core, i18n and form attributes. Example Bruch Karlsberg

value= attribute to value= can be used to set the value of the control when the value set is different than the contents string of the element. Example Brauerei G. A. Bruch, Saarbrücken

other attributes to label= can be set to label the option. if it is set, the user agent should use label rather than the content of the element. At least this is what the spec says. Firefox does not seem to agree. See forms/options.html for a test example. selected='selected' can be used to select an option.

This element has elements as its children. It takes the same attributes as. It is used to create hierarchical options. This is mainly a time and space-saving device in the presence of many options. Say Baltika 6 Guinness"/>

This is a way to add labels for inputs. Normally, the input label should be taken from the label= attribute of the control. But that only works if the label= attribute is available. can be used if the other method can not be.

the for= attribute to label The for= attribute says what control the label is for. You reference the control by its id=. Example: your height:

the push button This makes a button for decoration. It is not a form element strictly speaking because it can appear outside It takes a type= attribute that can be either be 'button', 'submit' or 'reset'. It has takes a name= attribute for the name of the control that it sets. It takes a value= attribute to set a value. It also takes the core and i18n attributes. And it can have character contents!

Thank you for your attention! Please shutdown computers when you are done.