CSE 154 LECTURE 8: FORMS

Similar documents
1 Form Basics CSC309

Web Programming Step by Step

Lecture 9 & 10 PHP - II

IT421-Web Site Development INF414-Web Based Information Systems Dr. Islam Taj-Eddin IT Dept., FCI, Assiut Univ.

CSE 154 LECTURE 9: SUBMITTING DATA (POST)

CSE 154 LECTURE 8: EVENTS AND TIMERS

CSE 154 LECTURE 9: SUBMITTING DATA (POST)

CSE 154 LECTURE 19: FORMS AND UPLOADING FILES

MORE JAVASCRIPT AND FORMS

Reset Buttons. More forms. Grouping input: <fieldset>,<legend> fieldset groups related input fields, adds a border; legend supplies a caption

Spring 2014 Interim. HTML forms

HTML Forms. By Jaroslav Mohapl

The Hypertext Markup Language (HTML) Part II. Hamid Zarrabi-Zadeh Web Programming Fall 2013

Databases HTML and PHP I. (GF Royle, N Spadaccini ) HTML/PHP I 1 / 28

CSS Review. Objec(ves. Iden(fy the Errors. Fixed CSS. CSS Organiza(on

HTML and JavaScript: Forms and Validation

HTML User Interface Controls. Interactive HTML user interfaces. Document Object Model (DOM)

core programming HTML Forms Sending Data to Server-Side Programs Marty Hall, Larry Brown

HTML Tables and Forms. Outline. Review. Review. Example Demo/ Walkthrough. CS 418/518 Web Programming Spring Tables to Display Data"

HTML: Fragments, Frames, and Forms. Overview

Creating and Building Websites

Summary 4/5. (contains info about the html)

Chapter 1 FORMS. SYS-ED/ Computer Education Techniques, Inc.

HTML forms and the dynamic web

COMS 359: Interactive Media

Lesson 3. Form By Raymond Tsang. Certificate Programme in Cyber Security

Form Overview. Form Processing. The Form Element. CMPT 165: Form Basics

HTML Tables and. Chapter Pearson. Fundamentals of Web Development. Randy Connolly and Ricardo Hoar

Forms 4/3/2018. Two way communication. Sending Data from Client to Server. One way communication:

Islamic University of Gaza Faculty of Engineering Department of Computer Engineering ECOM Advanced Internet Technology Lab.

Web Forms. Survey or poll Contact us Sign up for an newsletter Register for an event

CMPT 165 INTRODUCTION TO THE INTERNET AND THE WORLD WIDE WEB

Row and Column Spans. Homework. Column and Row Span Example (2) Column and Row Span Example. tables: Live Demo. like the following using forms:

HTML Form. Kanida Sinmai

HTML crashcourse. general structure tables forms textfield textarea selectbox listbox hidden field checkbox radiobuttons submit button

Overview of Forms. Forms are used all over the Web to: Types of forms: Accept information Provide interactivity

HTML Forms IT WS I - Lecture 11

LAB MANUAL SUBJECT: WEB TECHNOLOGY CLASS : T.E (COMPUTER) SEMESTER: VI

Forms, CGI. Objectives

Web Development. With PHP. Web Development With PHP

COMP1000 Mid-Session Test 2017s1

Web Design and Development ACS Chapter 13. Using Forms 11/27/2018 1

Web Site Design and Development Lecture 23. CS 0134 Fall 2018 Tues and Thurs 1:00 2:15PM

CHAPTER 6: CREATING A WEB FORM CREATED BY L. ASMA RIKLI (ADAPTED FROM HTML, CSS, AND DYNAMIC HTML BY CAREY)

Lecture : 3. Practical : 2. Course Credit. Tutorial : 0. Total : 5. Course Learning Outcomes

Web Designing Course

CS 350 COMPUTER/HUMAN INTERACTION. Lecture 6

B. V. Patel Institute of Business Management, Computer & Information Technology, UTU

Collecting Information with Forms

CSCB20 Week 11. Introduction to Database and Web Application Programming. Anna Bretscher* Winter 2017

Hyperlinks, Tables, Forms and Frameworks

Getting Data from the Web with R

Comp-206 : Introduction to Software Systems Lecture 23. Alexandre Denault Computer Science McGill University Fall 2006

Web Technologies - by G. Sreenivasulu Handout - 1 UNIT - I

jquery - Other Selectors In jquery the selectors are defined inside the $(" ") jquery wrapper also you have to use single quotes jquery wrapper.

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

Web Programming. Based on Notes by D. Hollinger Also Java Network Programming and Distributed Computing, Chs.. 9,10 Also Online Java Tutorial, Sun.

Creating HTML files using Notepad

A website is a way to present your content to the world, using HTML to present that content and make it look good

CSS CSS how to display to solve a problem External Style Sheets CSS files CSS Syntax

Creating Forms. Speaker: Ray Ryon

CSC Web Technologies, Spring HTML Review

Forms, CGI. Cristian Bogdan 2D2052 / 2D1335 F5 1

Outline of Lecture 5. Course Content. Objectives of Lecture 6 CGI and HTML Forms

FORM VALIDATION. June 2016 IJIRT Volume 3 Issue 1 ISSN: Himanshu Kapoor Dronacharya College Of Engineering, Khentawas, Gurgaon

cwhois Manual Copyright Vibralogix. All rights reserved.


COMPUTER APPLICATIONS IN BUSINESS FYBMS SEM II

ITEC447 Web Projects CHAPTER 9 FORMS 1

DAY 2. Creating Forms

Building Web Based Application using HTML

Student, Perfect Final Exam May 25, 2006 ID: Exam No CS-081/Vickery Page 1 of 6

INTRODUCTION TO WEB DEVELOPMENT AND HTML. Lecture 13: Intro to JavaScript - Spring 2011

JavaScript!= Java. Intro to JavaScript. What is JavaScript? Intro to JavaScript 4/17/2013 INTRODUCTION TO WEB DEVELOPMENT AND HTML

Chapter 3 HTML Multimedia and Inputs

Chapter 2. List, Tables,Frame and Forms

Session 10. Form Dataset. Lecture Objectives

HTML 5 Tables and Forms

B. V. Patel Institute of BMC & IT 2014

By completing this practical, the students will learn how to accomplish the following tasks:

Outline. Introducing Form. Introducing Forms 2/21/2013 INTRODUCTION TO WEB DEVELOPMENT AND HTML

Web development using PHP & MySQL with HTML5, CSS, JavaScript

HTML. HTML Evolution

Static Webpage Development

6Lesson 6: Web Forms Objectives

Dreamweaver: Web Forms

Lecture (03) from static HTML to

CSc 337 LECTURE 6: JAVASCRIPT

SYBMM ADVANCED COMPUTERS QUESTION BANK 2013

Controlled Assessment Task. Question 1 - Describe how this HTML code produces the form displayed in the browser.

UNIVERSITY OF TORONTO Faculty of Arts and Science APRIL 2016 EXAMINATIONS. CSC309H1 S Programming on the Web Instructor: Ahmed Shah Mashiyat

CGI Programming. What is "CGI"?

Creating Web Pages Using HTML

Networking and Internet

SilkTest 2009 R2. Rules for Object Recognition

Programming of web-based systems Introduction to HTML5

NukaCode - Front End - Bootstrap Documentation

Asynchronous JavaScript + XML (Ajax)

CS 112 Introduction to Programming

IEEM 230. PHP Basics, Part IV. Objectives of the lab:

Transcription:

CSE 154 LECTURE 8: FORMS

Web data most interesting web pages revolve around data examples: Google, IMDB, Digg, Facebook, YouTube, Rotten Tomatoes can take many formats: text, HTML, XML, multimedia many of them allow us to access their data some even allow us to submit our own new data most server-side web programs accept parameters that guide their execution

Query strings and parameters URL?name=value&name=value... http://www.google.com/search?q=romney http://example.com/student_login.php?username=obourn&id=1234567 query string: a set of parameters passed from a browser to a web server often passed by placing name/value pairs at the end of a URL above, parameter username has value obourn, and sid has value 1234567 PHP code on the server can examine and utilize the value of parameters a way for PHP code to produce different based on values passed by the user

Query parameters: $_GET, $_POST $user_name = $_GET["username"]; $id_number = (int) $_GET["id"]; $eats_meat = FALSE; if (isset($_get["meat"])) { $eats_meat = TRUE; } PHP $_GET["parameter name"] or $_POST["parameter name"] returns a GET/POST parameter's value as a string parameters specified as http://...?name=value&name=value are GET parameters test whether a given parameter was passed with isset

Example: Exponents $base = $_GET["base"]; $exp = $_GET["exponent"]; $result = pow($base, $exp); print "$base ^ $exp = $result"; exponent.php?base=3&exponent=4 3 ^ 4 = 81 PHP

Example: Print all parameters <?php foreach ($_GET as $param => $value) {?> <p>parameter <?= $param?> has value <?= $value?></p> <?php }?> print_params.php?name=allison+obourn&sid=1234567 Parameter name has value Allison Obourn Parameter sid has value 1234567 PHP or call print_r or var_dump on $_GET for debugging

HTML forms form: a group of UI controls that accepts information from the user and sends the information to a web server the information is sent to the server as a query string JavaScript can be used to create interactive controls (seen later)

HTML form: <form> <form action="destination URL"> form controls </form> HTML required action attribute gives the URL of the page that will process this form's data when form has been filled out and submitted, its data will be sent to the action's URL one page may contain many forms if so desired

Form example <form action="http://www.google.com/search"> <div> Let's search Google: <input name="q" /> <input type="submit" /> </div> </form> Let's search Google: HTML must wrap the form's controls in a block element such as div

Form controls: <input> <!-- 'q' happens to be the name of Google's required parameter --> <input type="text" name="q" value="colbert Report" /> <input type="submit" value="booyah!" /> HTML input element is used to create many UI controls an inline element that MUST be self-closed name attribute specifies name of query parameter to pass to server type can be button, checkbox, file, hidden, password, radio, reset, submit, text,... value attribute specifies control's initial text

Text fields: <input> <input type="text" size="10" maxlength="8" /> NetID <br /> <input type="password" size="16" /> Password <input type="submit" value="log In" /> HTML input attributes: disabled, maxlength, readonly, size, value size attribute controls onscreen width of text field maxlength limits how many characters user is able to type into field

Text boxes: <textarea> a multi-line text input area (inline) <textarea rows="4" cols="20"> Type your comments here. </textarea> HTML initial text is placed inside textarea tag (optional) required rows and cols attributes specify height/width in characters optional readonly attribute means text cannot be modified

Checkboxes: <input> yes/no choices that can be checked and unchecked (inline) <input type="checkbox" name="lettuce" /> Lettuce <input type="checkbox" name="tomato" checked="checked" /> Tomato <input type="checkbox" name="pickles" checked="checked" /> Pickles HTML none, 1, or many checkboxes can be checked at same time when sent to server, any checked boxes will be sent with value on: http://webster.cs.washington.edu/params.php?tomato=on&pickles=on use checked="checked" attribute in HTML to initially check the box

Radio buttons: <input> sets of mutually exclusive choices (inline) <input type="radio" name="cc" value="visa" checked="checked" /> Visa <input type="radio" name="cc" value="mastercard" /> MasterCard <input type="radio" name="cc" value="amex" /> American Express HTML grouped by name attribute (only one can be checked at a time) must specify a value for each one or else it will be sent as value on

Text labels: <label> <label><input type="radio" name="cc" value="visa" checked="checked" /> Visa</label> <label><input type="radio" name="cc" value="mastercard" /> MasterCard</label> <label><input type="radio" name="cc" value="amex" /> American Express</label> HTML associates nearby text with control, so you can click text to activate control can be used with checkboxes or radio buttons label element can be targeted by CSS style rules

Reset buttons Name: <input type="text" name="name" /> <br /> Food: <input type="text" name="meal" value="pizza" /> <br /> <label>meat? <input type="checkbox" name="meat" /></label> <br /> <input type="reset" /> HTML when clicked, returns all form controls to their initial values specify custom text on the button by setting its value attribute

Hidden input parameters <input type="text" name="username" /> Name <br /> <input type="text" name="sid" /> SID <br /> <input type="hidden" name="school" value="uw" /> <input type="hidden" name="year" value="2048" /> HTML an invisible parameter that is still passed to the server when form is submitted useful for passing on additional state that isn't modified by the user

Styling form controls element[attribute="value"] { property : value; property : value;... property : value; } CSS input[type="text"] { background-color: yellow; font-weight: bold; } CSS attribute selector: matches only elements that have a particular attribute value useful for controls because many share the same element (input)