Introduction to Programming the WWW I CMSC 10100-1 Summer 2004 Lecture 5.

Slides:



Advertisements
Similar presentations
The Web Wizards Guide to HTML Chapter Six Tables.
Advertisements

HTML Forms. collect information for passing to server- side processes built up from standard widgets –text-input, radio buttons, check boxes, option lists,
Tables Tables provide a means of organising the layout of data
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?
Multimedia and the World Wide Web HCI 201 Lecture Notes #5A.
Intermediate Level Course. Text Format The text styles, bold, italics, underlining, superscript and subscript, can be easily added to selected text. Text.
HTML and XHTML Controlling the Display Of Web Content.
Markup Languages Controlling the Display Of Web Content.
Computing Concepts Advanced HTML: Tables and Forms.
Tutorial 8 Designing a Web Site with Frames. XP Objectives Explore the uses of frames in a Web site Create a frameset consisting of rows and columns of.
Create a Web Site with Frames
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic Table, Forms, Metatags and Frames.
Session 2 Tables and forms in HTML Adapted by Sophie Peter from original document by Charlie Foulkes.
Creating Web Page Forms
 You've probably come into contact with web sites in which the browser window seemingly allowed you to move around between several different pages. 
XP Tutorial 5New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Designing a Web Site with Frames Using Frames to Display Multiple Web Pages Tutorial.
XHTML1 Topics Work with the Frameset Document Type Definition (DTD) Create frames Use the target and base attributes Create nested frames Format frames.
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 Creating Web Forms in HTML Web forms collect information from customers Web forms include different control elements including: –Input boxes –Selection.
Chapter 6: Forms JavaScript - Introductory. Previewing the Product Registration Form.
XP 1 Tutorial 5 Using Frames in a Web Site. XP 2 Tutorial Objectives  Describe the uses of frames in a Web site  Lay out frames within a browser window.
XP Using Frames in a Web Site Ali Alfayly. XP Tutorial Objectives Create frames for a Web site Control the appearance and placement of frames Control.
FRAMES. With frames, we can display more than one HTML document in the same browser window. Each HTML document is called the same browser window. Each.
225 City Avenue, Suite 106 Bala Cynwyd, PA , phone , fax presents… HTML Lists, Tables and Forms v2.0.
Dr. Nuha El-KhaliliInternet Programming ( ) HTML Hyper Text Markup Language The language of web pages Maintained by the W3C
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML Pt. 2.
Introduction to Programming the WWW I CMSC Summer 2004 Lecture 6.
The Web Wizard’s Guide to HTML Chapter Seven Frames.
Frame Page A Frame Page does the following: –Defines the size of each frame. –Defines how the window will be broken up – rows or columns. –Specifies which.
Tutorial 8 Designing a Web Site with Frames. XP Objectives Explore the uses of frames in a Web site Create a frameset consisting of rows and columns of.
Chapter 12 FRAMES. HOW FRAMES WORK When you view a framed page in a browser, you are actually looking at several HTML documents at once. The key to making.
Copyright (c) 2004 Prentice-Hall. All rights reserved. 1 Committed to Shaping the Next Generation of IT Experts. Project 7: Working with Frames Kelly L.
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
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.
Introduction to Programming the WWW I CMSC Summer 2003 Lecture 5.
Week 11 Creating Framed Layouts Objectives Understand the benefits and drawbacks of frames Understand and use frame syntax Customize frame characteristics.
Forms and Server Side Includes. What are Forms? Forms are used to get user input We’ve all used them before. For example, ever had to sign up for courses.
76 © 1998, 1999, 2000 David T. Gray, Howard Duncan, Jane Kernan Frames When displaying information in a browser, it is sometimes useful to divide the display.
HTML : Forms, Frames Instructor: Mr. Ahmed Al Astal ITGD4104 Department Requirement for senior student University of Palestine Faculty of IT.
Introduction to Programming the WWW I CMSC Winter 2003 Lecture 6.
Chapter 8 HTML Frames. 2 Principles of Web Design Chapter 8 Objectives Understand the benefits and drawbacks of frames Understand and use frames syntax.
Jozef Goetz, © 2011 Pearson Education Copyright (c) 2007Prentice-Hall. All rights reserved.
Chapter 5 Quick Links Slide 2 Performance Objectives Understanding Framesets and Frames Creating Framesets and Frames Selecting Framesets and Frames Using.
The Web Wizard’s Guide to HTML Chapter Seven Frames.
ITCS373: Internet Technology Lecture 5: More HTML.
Tutorial 8 Designing a Web Site with Frames. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Explore the uses of frames.
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.
Lecture 6 More Advanced HTML Boriana Koleva Room: C54
CSE 409 – Advanced Internet Technology 1 DISCUSSION OF BASIC HTML TAGS.
Copyright © Texas Education Agency, All rights reserved.1 Web Technologies Website Forms / Data Acquisition.
Introduction to Programming the WWW I CMSC Winter 2004 Lecture 5.
HTML Forms.
Chapter 9 Quick Links Slide 2 Performance Objectives Understanding Forms Planning Forms Creating Forms Creating Text Fields Creating Hidden Fields Creating.
20-753: Fundamentals of Web Programming 1 Lecture 6: Advanced HTML Fundamentals of Web Programming Lecture 6: Advanced HTML.
Copyright (c) 2004 Prentice-Hall. All rights reserved. 1 Committed to Shaping the Next Generation of IT Experts. Project 6: Creating XHTML Forms Kelly.
1 HTML Frames
Web Technology (NCS-504) Prepared By Mr. Abhishek Kesharwani Assistant Professor,UCER Naini,Allahabad.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
XP New Perspectives on Macromedia Dreamweaver MX 2004 Tutorial 5 1 Adding Shared Site Elements.
Introduction to Programming the WWW I CMSC Winter 2003 Lecture 5.
Jozef Goetz, © 2011 Pearson Education Copyright (c) 2007Prentice-Hall. All rights reserved.
XHTML Introductory1 Frames Chapter 5. XHTML Introductory2 Objectives In this chapter, you will: Work with the Frameset Document Type Definition (DTD)
HTML Tables Tables are defined with the tag. A table is divided into rows (with the tag), and each row is divided into data cells (with the tag). td stands.
HTML Comprehensive Concepts and Techniques Second Edition Creating Frames on a Web Page.
Introduction to HTML.
Tables and Frames.
Basic XHTML Tables XHTML tables—a frequently used feature that organizes data into rows and columns. Tables are defined with the table element. Table.
Chapter 5 Introduction to XHTML: Part 2
Web Programming– UFCFB Lecture 10
Presentation transcript:

Introduction to Programming the WWW I CMSC Summer 2004 Lecture 5

2 Today’s Topics HTML Tables (cont’d) HTML Frames HTML Forms

3 Review: Typical Table Sketch Code Sample Table headrow-col1 … headrow-coln row1-col1 … row1-coln … rowm-col1 … rowm-coln sampletable.html

4 Tables and Text Text is hard to read against a busy background pattern, but you can lay a table containing text on top of a background pattern without sacrificing readability (just give the table a solid background color)  Examples: table_text2.html vs. table_text1.htmltable_text2.htmltable_text1.html Tables can also be used to separate text into two columns (a cellpadding=“20” table attribute will put white space between the two columns)  Example: table_2col.htmltable_2col.html

5 Tables and Graphics Tables can be used to control a Web page layout for multiple images (or images mixed with text) Images of different sizes can be fit together in irregularly-shaped tables using cell-structure diagrams All tables have an underlying cell structure with a uniform number of table cells across each table row

6 Web Page Borders Empty table columns can be used to create margins for text on a Web page  Use a fixed width attribute (e.g. width=“50” ) for the empty table data element Put an internal table inside  Example: innertable.htmlinnertable.html Note: better to control margins with CSS

7 One vs. Many If you have one very large table, try to break it up into a sequence of smaller tables that can be stacked vertically on a Web page Browsers download the contents of an entire table before any of the table can be viewed Multiple tables will be displayed incrementally so the user will be able to see the first part of your page while the rest of the page is still downloading

8 Disadvantages of tables for layout Complex layout requires complex tables (lots of headaches, room for error) Complex tables can download, be rendered slowly Scalability issues  Not all browsers can read tables

9 HTML Frames HTML frames allow to display multiple HTML documents in a same browser window  The browser window is divided into multiple regions, or frames  Each frame displays a unique web page  Each frame is independent of the others

10 Frame Code Structure … … use no-frame version

11 The Frameset Element The frameset tag pair should follow the head element, replacing the body element The cols and rows attributes are used to divide the Web page into frames Each frame is represented by a separate frame element

12 Setting up rows and columns Specify a certain number of rows or columns of certain sizes by This makes a three columns of 100 pixels, 300 pixels, and the rest of the screen Example: frameseta.htmlframeseta.html Can also use percentages (n%) Note: use no more than one * in the list

13 The Frame Element Each frame tag should contain a name attribute  The name attribute is used for targeting links (discuss later) Each frame tag should contain a src attribute that specifies a Web page Can shutdown resizing by adding noresize Can turn off scroll bars with scrolling=“no” frame is a standalone(self-closing) tag

14 Some more attributes You may specify frameborder, framespacing, and border attributes Only border seems to have a big effect See HTML p. 136, and W3C online for more information Examples:  frameseta1.html (border="5" framespacing="5“) frameseta1.html  frameseta2.html (frameborder="0" border="0" framespacing="0“) frameseta2.html

15 Tabular layout By setting both the cols and rows attributes, you create a table of frames Frames are listed row by row Example: framesetb.htmlframesetb.html

16 Nested framesets Irregular layouts are useful (the equivalent of using rowspan or colspan in a table layout) You can specify a instead of a to create nested framesets Or, you can set the src for a frame to point to a frameset file Example: framesetc.htmlframesetc.html

17 Linking in frames Each frame may contain hyperlinks Each hyperlink can be targeted to different frame or a new window It is achieved by the target attribute of tag

18 The target attribute Target link to a named frame  Example:  loads the source into a frame named myframe  useful when using frames for site navigation HTML defined target values  _blank opens a new, unnamed window  _self opens the link in the current frame (default)  _top opens the link in the full, unframed browser window (throws you out of the frameset)  _parent opens the link in the immediate frameset parent (calling frame) Example: framesetd1.htmlframesetd1.html

19 The base tag Rather than specifying the target for each link, you can add a line in head element  Example:  Sets default links to the frame named right  Can also set default link targets to be “_top” to leave the site Example: framesetd2.htmlframesetd2.html

20 Avoid Deep Linking A deep link is any absolute link inside a framed Web page that displays the destination page inside the frame system Deep linking should be avoided, why?  Copyright issues, might be illegal You can avoid deep links by sending them to a new browser window  Any link can be routed to a new browser window with the target attribute

21 Frames for Site Navigation A typical frame layout uses two nested frameset elements to divide a Web page into three frames: 1.The title frame runs across the top of the Web page 2.A navigational frame occupies a left-hand border under the title frame 3.A content frame occupies the remainder of the Web page Example: framesetd.htmlframesetd.html

22 Art Galleries with Frames A three-frame layout works well for an online art gallery Fill the navigation frame with clickable thumbnail previews When a user clicks on a thumbnail preview, send the original image to the content frame Example: framesete.htmlframesete.html

23 Advantages of Frames Frames support intuitive site layouts that are easy to navigate Site development efforts can focus on content and navigation as independent problems Scalability: write one navigation tool bar and stick it in a frame - only change one file to change navigation system

24 Problems with Frames Not all browsers support frames (try it on a palm!) It is difficult for others to link to content inside a frame It’s easy to create deep links by accident Tougher to save sub-pages, messy with browser cache Complex layout awkward Doesn’t control layout inside each frame It is difficult to print the entire page

25 Frames vs. tables Tables are tougher to code (but this is fixable through scripting) Tables have wider (but not universal) support on browsers Frames are really quick to get going

26 HTML Forms HTML Forms are used to select different kinds of user input, defined with tag Form contains form elements to allow the user to enter information  text fields  textarea fields  drop-down menus  radio buttons  checkboxes, etc A Web page can contain one or multiple forms  Identified by id or name attribute

27 Attributes action attribute  Gives the URL of the program(CGI) to receive and process the form’s data CGI is Common Gateway Interface, a protocol to handle web data transmissions How does CGI work? (next slide) CGI programs usually kept in a cgi-bin/ directory Usually triggered by clicking the submit button action can also be a mailto: link  Syntax: action=mailto:XXX  Example : formeg.html formeg.html Example:  add.html using CGI programs in action add.html

28 How Browsers and Web Applications Work with CGI

29 Tag Attributes (cont’d) method attribute  Sets the HTTP method by which the browser sends the form data to the program, value can be GET or POST HTTP protocol specification Simple HTTP request and reply  GET method: The form data gets appended to the request URL  POST method: The form data is sent as part of the message body  Avoid GET method in favor of POST for security reasons A long form content line attached to URL may crash the web server The GET request line is plain ASCII text sent without encryption and will be saved in server logs Example:  add.html using CGI programs in action add.html

30 Tag Attributes (cont’d) enctype attribute  Specify the content type used to submit the form to the server when the action method is POST  Default value application/x-www-form-urlencoded (need not specify)  Special cases: Use “ text/plain ” if action=mailto:XXX Use "multipart/form-data“ if the data sent is a file the id, name attributes  Give the identification or name to a form  Useful for multiple forms in a same page  id is preferable

31 Tag To define any one of a number of common form “controls”  Text fields (including password, hidden fields)  multiple-choice lists  Clickable images  Submission buttons Only type and name attribute required No ending tag (no )

32 Text Fields single line of text  Set type to password to mask text like a password Set type to hidden to create a hidden field  size and maxlength attributes  value attributes to give default text Example: formeg1.htmlformeg1.html

33 Multi-line Text Area The tag Attributes  cols  rows  wrap Values: Off,virtual(default),physical Example: formeg1.htmlformeg1.html

34 Check Boxes Check boxes for “check all that apply” questions   Make sure name identical among a group of checkboxes  checked attribute When form is submitted, names and values of those checked boxes are sent Example: formeg1.htmlformeg1.html

35 Radio Buttons Similar as checkboxes, but only one in the group may be selected  Example: formeg1.htmlformeg1.html

36 Multiple Choice Elements The tag creates either pull-down menus or scrolling lists The tag defines each item within a tag tag attributes  size attribute Number of rows visible at the same time  multiple attribute If set, allow multiple selections  name attribute Example: formeg1.htmlformeg1.html

37 Action Buttons Some special types of form controls  Act immediately  Effect can not be reversed  Affect the entire content of the form

38 Action Buttons (cont’d) What are they?  Submit buttons  Reset buttons  Regular buttons  image buttons (will send form content as submit button)  *File buttons (need to deal with enctyple attribute) Example: formeg1-bak.htmlformeg1-bak.html

39 HTML Forms Resources HTML Forms tutorials   HTML Forms and Input 