© 2004, Robert K. Moniot Chapter 5 Introduction to HTML, Continued.

Slides:



Advertisements
Similar presentations
HTML Forms. collect information for passing to server- side processes built up from standard widgets –text-input, radio buttons, check boxes, option lists,
Advertisements

Tables Tables provide a means of organising the layout of data
Chapter 3 – Web Design Tables & Page Layout
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?
24-Aug-14 HTML Forms. 2 What are forms? is just another kind of HTML tag HTML forms are used to create (rather primitive) GUIs on Web pages Usually the.
CREATED BY : VIRAL M.KORADIYA. Anchor elements are defined by the element. The element accepts several attributes, but either the Name or HREF attribute.
Computer and Communication Fundamental Basic web programming Lecture 8 Rina Zviel-Girshin.
Multimedia and the World Wide Web HCI 201 Lecture Notes #5A.
Chapter 5 Creating an Image Map.
Image Maps and Graphics Internet Basics and Far Beyond! Mrs. Wilson.
XP 1 Designing a Web Site with Frames Using Frames to Display Multiple Web Pages Tutorial 5.
© 2004, Robert K. Moniot Chapters 4 & 5 Introduction to HTML, More Details.
Creating a Web Page with Tables. Objectives Create a text table with preformatted text Create the basic structure of a graphical table Organize table.
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.
The Power of Tables They aren't just for sitting stuff on anymore...
 2003 Prentice Hall, Inc. All rights reserved. Chapter 5 - Introduction to XHTML: Part 2 Outline 5.1 Introduction 5.2 Basic XHTML Tables 5.3 Intermediate.
Create a Web Site with Frames
Session 2 Tables and forms in HTML Adapted by Sophie Peter from original document by Charlie Foulkes.
Creating Web Page Forms
Copyright © 2004 ProsoftTraining, All Rights Reserved. Lesson 9: Frames © 2007 Prosoft Learning Corporation All rights reserved ITD 110 Web Page Design.
Copyright © 2004 ProsoftTraining, All Rights Reserved. Lesson 9: HTML Frames.
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.
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.
XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 1 Creating Web Page Forms Designing a Product Registration Form Tutorial 6.
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.
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.
XHTML Introductory1 Forms Chapter 7. XHTML Introductory2 Objectives In this chapter, you will: Study elements Learn about input fields Use the element.
HTML II. Factors to consider in designing a website. Organizing your files. HTML Tables. Unordered Lists. Ordered Lists. HTML Forms. Learning Objectives.
225 City Avenue, Suite 106 Bala Cynwyd, PA , phone , fax presents… HTML Lists, Tables and Forms v2.0.
Robinson_CIS_285_2005 HTML FORMS CIS 285 Winter_2005 Instructor: Mary Robinson.
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.
Chapter 5: XHTML, Part 2 CIS 275—Web Application Development for Business I.
 2004 Prentice Hall, Inc. All rights reserved. Chapter 5 - Introduction to XHTML: Part 2 Outline 5.1 Introduction 5.2 Basic XHTML Tables 5.3 Intermediate.
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.
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.
Designing a Web Page with Tables. A text table: contains only text, evenly spaced on the Web page in rows and columns uses only standard word processing.
Chapter 2 XHTML: Part II The Web Warrior Guide to Web Design Technologies.
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
Week 11 Creating Framed Layouts Objectives Understand the benefits and drawbacks of frames Understand and use frame syntax Customize frame characteristics.
LOGO FORMs in HTML CHAPTER 5 Eastern Mediterranean University School of Computing and Technology Department of Information Technology ITEC229 Client-Side.
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.
Windows and frames and the anchor tag. Frames Independent, scrollable portions of a Web browser window, with each frame capable of containing its own.
Chapter 5 Quick Links Slide 2 Performance Objectives Understanding Framesets and Frames Creating Framesets and Frames Selecting Framesets and Frames Using.
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.
Chapter 2: Variables, Functions, Objects, and Events JavaScript - Introductory.
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.
Windows and frames and the anchor tag. Frames Independent, scrollable portions of a Web browser window, with each frame capable of containing its own.
Lecture 6 More Advanced HTML Boriana Koleva Room: C54
©SoftMooreSlide 1 Introduction to HTML: Forms ©SoftMooreSlide 2 Forms Forms provide a simple mechanism for collecting user data and submitting it to.
Introduction to HTML. _______________________________________________________________________________________________________________ 2 Outline Key issues.
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.
1 Creating the Home Page. 2 Creating a Table Table attributes  Two rows and two columns  No border  Left-aligned Change the vertical alignment of the.
XP Review 1 New Perspectives on JavaScript, Comprehensive1 Introducing HTML and XHTML Creating Web Pages with HTML.
What is HTML? HTML is a language for describing web pages. HTML stands for Hyper Text Markup Language HTML is not a programming language, it is a markup.
20-753: Fundamentals of Web Programming 1 Lecture 6: Advanced HTML Fundamentals of Web Programming Lecture 6: Advanced HTML.
1 HTML Forms
1 HTML Frames
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
`. Lecture Overview HTML Body Elements Linking techniques HyperText references Linking images Linking to locations on a page Linking to a fragment on.
XP New Perspectives on Macromedia Dreamweaver MX 2004 Tutorial 5 1 Adding Shared Site Elements.
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.
Chapter 6 Frames and Image Maps Frame sets and frames Image Maps.
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
Chapter 5 - Introduction to XHTML: Part 2
Presentation transcript:

© 2004, Robert K. Moniot Chapter 5 Introduction to HTML, Continued

© 2004, Robert K. Moniot Tables A table organizes content into a grid of horizontal rows and vertical columns. The table area is enclosed in... A table row is started with (closing tag optional). Within each row, a table column item is started with (closing tag optional). Use instead, for column headings. Example 6

© 2004, Robert K. Moniot Forms HTML forms allow the user to supply data to the web server. We will focus on creating the form in HTML so it appears to the user with input fields and descriptive text, ready to be filled in. When the form is submitted, the data entered into the input fields is sent back to the web server and processed, for instance by a CGI program. We will not study CGI programming at this time.

© 2004, Robert K. Moniot Defining A Form A form is defined as follows:... (form fields and descriptive text go here) The optional name attribute gives the form a name. This is useful when using JavaScript to access the form. The “path to cgi” is a URL specifying the location of the CGI program that will process the form. The method attribute can be either "get" or "post". The region between the opening and closing form tags can contain input fields and any sort of normal HTML content.

© 2004, Robert K. Moniot Form Submit Methods Method "get" –The input data are appended to the URL of the request sent to the server when the form is submitted. The server passes the data to the CGI through an environment variable. –This method is primitive and suitable only for very small amounts of form data. It is deprecated nowadays. Method "post" –The input data are sent to the server in a data body following the request headers. The server passes the data to the CGI through an input mechanism. –This is the preferred method.

© 2004, Robert K. Moniot Form Input Fields The most common type of form input field is defined using the tag, which allows for various types of input elements: text boxes, check boxes, etc. The general form of this tag is Note that there is never a closing tag, since this defines an element, not a region. The name attribute gives the input field a name, which is useful for JavaScript and CGI processing. The type attribute allows different kinds of input fields to be defined. Depending on the field type, there may be other attributes to control other properties of the element.

© 2004, Robert K. Moniot Input Field Types The type attribute can take on one of the following values: text - specifies a small box in which the user can type text. password - like text, but the text which is typed appears as asterisks, though it is submitted to the server as typed. checkbox - specifies a box which can be clicked to check or un- check it. radio - specifies a “radio button.” Several buttons of this kind are usually defined as a group, each button of the group having the same name. A radio button is like a checkbox except that only one button of the group can be selected at a time.

© 2004, Robert K. Moniot Special Input Types There are some other input types that are special: submit - specifies a Submit button that sends the completed form data to the server. reset - specifies a Reset button that restores all input fields of the form to their default initial values. hidden - used to provide data that the user does not see.

© 2004, Robert K. Moniot Other Tag Attributes size="width" for input fields of type text or password. The width is an integer giviing the width of the box in characters. Default width is 20. maxlength="length" for fields of type text or password. Specifies the maximum number of characters that can be entered into the box. checked (this attribute takes no value) for checkbox and radio buttons. If this attribute is present, the box or button is selected by default. value="value" specifies a default value for the item or, for submit and reset buttons, a label for the button.

© 2004, Robert K. Moniot Form Menu Elements A menu is defined as follows: menu item 1 menu item 2...

© 2004, Robert K. Moniot Form Menu Elements Default appearance of a select element is to present the selected menu item in a text box, with a scroll button at one side that pops up the menu to allow selecting a different item. To create a menu that displays several options in the window, include the attribute size="length" where length is the number of items to show. Normally, only one item from the list can be selected. To allow multiple items to be selected, add the attribute multiple. The item tag allows the attribute selected to indicate that the item should be selected by default.

© 2004, Robert K. Moniot The textarea Element The text type of input element is intended only for small amounts of text. To provide space for more input text, as well as scrollbars, use this element. Example: Default text can be placed here. Example 7

© 2004, Robert K. Moniot Image Maps An image map is an image that has “hot spots” defined, i.e. different places on the image are links to various URLs. Examples of use: –A map of a country, with hot spots defined for different regions of the country, each linked to a document referring to that region. –An image consisting of text labels acting as links. This method allows the text to use fancier fonts or color schemes than the browser's supported text fonts, or to arrange the links in a way (such as in a circle) that would be hard to achieve using an HTML table or list.

© 2004, Robert K. Moniot Image Maps Image maps can be of two types: –client-side map: the browser determines the URL that corresponds to the hot spot where the mouse is, and opens that link when the user clicks on it. –server-side map: when the user clicks on a point in the image, the browser simply sends that pixel's location to the server, where the appropriate action is taken. In most cases, the client-side map is preferable. For instance, it can also be used with text-only browsers. For some applications, for instance to center or zoom in on a selected point of the image, a server-side map is required.

© 2004, Robert K. Moniot Elements of an Image Map An image map consists of three coordinated elements: the image, the map, and the document that uses the map. The image is always in a separate file, referenced using an tag. A client-side map is usually contained in the document that uses it. A server-side map is in a separate file, or it may be a CGI program. We discuss client-side image maps first.

© 2004, Robert K. Moniot The Image The creation of an image to use as a map is outside the scope of this course. Images can be obtained by: –taking a photo with a digital camera –digitizing a photo print using a scanner –drawing a picture on a computer, using a program such as Paint or the GIMP –using available clip art or stock pictures (but be sure to abide by copyright rules!) You will need to know the size of the image in pixels (picture elements). This information can be gotten by –file information provided by system, e.g. Windows XP –using an image manipulation program that reports the image size

© 2004, Robert K. Moniot Pixel Numbering Convention A specific pixel (picture element) is identified by a pair of numbers, giving the horizontal dimension (x) first and the vertical dimension (y) second, separated by a comma. Pixel numbering starts from 0,0 at the top left of the image. Since the numbering starts from 0, the maximum pixel number in a given direction is 1 less than the image size in that direction. –For instance, if an image is 200 pixels wide and 300 pixels high, the bottom right corner pixel has coordinates 199,299.

© 2004, Robert K. Moniot The Map The image map specifies a set of shapes that occupy different regions of the image. Each shape is associated with a URL that is the location to be opened when the user clicks over that shape. Rules about coverage: –The regions need not cover the image completely. If the user clicks on a part of the image that is not within any defined region, nothing happens. –Regions may overlap. Clicking on the overlapping parts of two regions selects the region that is defined first in the map. –To handle clicks that are not within any of the defined regions, you can define a rectangular area that covers the whole image, placing this last in the map.

© 2004, Robert K. Moniot Defining a Map A client-side map is placed somewhere in the body of the document that uses it. The form of a map definition is: <area href="URL" shape="shape" coords="x,y,..." alt="alternate text"> <area href="URL" shape="shape" coords="x,y,..." alt="alternate text">... The map-name gives the map a name that will be used to associate it with an image. The tag will be discussed in the next slide.

© 2004, Robert K. Moniot The Tag There is no closing tag for the element. The URL is the link target to be opened when the region defined by this element is clicked. The shape attribute value is one of rect (rectangle), circle, or poly (polygon), described in the next slide. The number of values in the coords list will vary depending on the shape. The alt attribute provides alternate text for non- graphical browsers. <area href="URL" shape="shape" coords="x,y,..." alt="alternate text">

© 2004, Robert K. Moniot Shapes The shape attribute of the element can be one of the following: –rect : takes two x,y pairs in the coords list. The first pair is the upper left corner of the rectangle, and the second pair is the lower right corner. –circle : takes three numbers in the coords list. The first two numbers are the x,y location of the center of the circle, and the third is the radius. –poly : takes three or more x,y pairs in the coords list. Each x,y pair is a vertex of the polygon. The first and last pair should be the same to close the polygon, though most browsers will infer a closing point if it is omitted.

© 2004, Robert K. Moniot Using an Image Map The document that uses the image map needs to include both the map (as an element somewhere in the body) and the image (as another element somewhere in the body). The map does not appear in the rendered page, so its location in the document is not important. Usually the map is placed immediately before or after the image for convenience. The image is included as usual by means of an tag, with an extra attribute to specify the map: The map-name is the name defined by the map's name attribute.

© 2004, Robert K. Moniot Using an Image Map The tag can use the usual other attributes specifying the height, width, and alternate text. It also is usually desirable to include the attribute border="0" This suppresses the thin border that is normally put around an image. Most browsers color this border a special color when an image is a map, which is usually not desirable. You can tell that the image has hot spots and where they are by moving the mouse over the image. The browser's status box will show the URL of the link corresponding to the region under the mouse. Also, Internet Explorer (but not Netscape) will pop up a “balloon” with the alternate text of the region. Example 9

© 2004, Robert K. Moniot Server-side Image Map A server-side image map is defined by two steps: –Make the image the link text of a link that references the server- side image map or CGI that will handle the mapping operation. –Include the ismap attribute in the tag. The URL of the link can be a server-side image map defined in a text file, which is similar to a client-side map, but has a different syntax that depends on the web server that is used. It is preferred nowadays to use client-side maps instead for this purpose. Alternatively, the URL of the link can be a CGI that is able to process the pixel coordinates which are sent when the user clicks on the image. This is the preferred mode for using server-side maps.

© 2004, Robert K. Moniot Server-side Image Map Form of a server-side image map using a CGI to process the request: The “path to cgi” is the URL of the CGI program that will receive the pixel location when the user clicks on a point in the image.

© 2004, Robert K. Moniot Server-side Image Map Hint: You can use this as a simple technique to find out pixel locations of points on your image when you are constructing a client-side map: make the image into a server-side map temporarily and read off the coordinates of any chosen points in the status box. For instance, in the above example, 298,42 is the x,y location of the mouse at this moment. Example 10 When the mouse is over the image, you will see something like this in the status box of the browser: This is the browser's syntax for invoking a CGI using the get method. Everything up to the question mark is the URL of the CGI. The text following the question mark is the data that will be sent to the CGI, in this case the coordinates of the pixel where the mouse is clicked.

© 2004, Robert K. Moniot Frames The use of frames allows a browser to display more than one web page in the same window simultaneously. Typically frames are used to provide navigation elements or logos that remain fixed while the main content area changes. Frames are introduced by using the element. Note: A page that has a element cannot have a element. The element of a page that uses frames replaces the element of a non-frame page.

© 2004, Robert K. Moniot Frames The overall structure of a page that uses frames is:... (head portion as usual) (material for browsers that do not recognize frames)

© 2004, Robert K. Moniot Attributes of The tag normally has one attribute that defines the spacing of the frames either horizontally or vertically on the screen. For example: specifies that there are two frames in the frameset side by side, the first occupying 20% of the width of the window, and the other occupying the balance. Each frame extends the entire height of the window. specifies that there are three frames in the frameset, one above the other. The first occupies 50 pixels of height, the next 100 pixels, and the last takes up all the rest of the available vertical space. Each frame extends the entire width of the window. If both rows and cols attributes are specified, then the frames are laid out in a grid.

© 2004, Robert K. Moniot Nesting Of Framesets One frameset can be nested inside another. This allows more complicated layouts than horizontal tiles, vertical tiles, or a grid. The nested frameset occupies the space where otherwise a single frame of the enclosing frameset would go. Example 10

© 2004, Robert K. Moniot The Tag Older browsers may not support frames. Such browsers will not see a document body and will display a blank page. To avoid this, use the tag to provide content for these older browsers. The tag is, of course, unknown to such browsers, so they will ignore it. You can place a short document body within this area and it will be displayed by these browsers. Frame-aware browsers ignore all content between tags. The noframes content should be placed inside a element because some browsers will not display content that is not in a document body. Example 10

© 2004, Robert K. Moniot Linking Between Frames Very often it is desired for a link located in one frame to open in another frame. This is achieved using the target attribute in the link element: Link text. When the link text is clicked, the URL will be opened in the frame whose name attribute is frame-name. The frame containing this link will remain in place. Example 10

© 2004, Robert K. Moniot Special target names The target attribute of a link in a frame can have one of the following special values: _blank opens the target URL in a new browser window. _self opens the target URL in the same frame as the anchor (replacing the frame content). _top opens the target URL in the whole browser window (replacing all frames).