Chapter4: HTML Table and Script page, HTML5 new forms. Asst. Prof. Dr. Supakit Nootyaskool Information Technology, KMITL

Similar documents
Web Design and Application Development

COMSC-030 Web Site Development- Part 1. Part-Time Instructor: Joenil Mistal

Tutorial 5 Working with Tables and Columns. HTML and CSS 6 TH EDITION

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

Chapter 4 Notes. Creating Tables in a Website

As we design and build out our HTML pages, there are some basics that we may follow for each page, site, and application.

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

Html basics Course Outline

Dreamweaver CS3 Concepts and Techniques

INFS 2150 / 7150 Intro to Web Development / HTML Programming

IMY 110 Theme 7 HTML Tables

Hyperlinks, Tables, Forms and Frameworks

1/6/ :28 AM Approved New Course (First Version) CS 50A Course Outline as of Fall 2014

Welcome. Web Authoring: HTML - Advanced Topics & Photo Optimisation (Level 3) Richard Hey & Barny Baggs

Spring 2014 Interim. HTML forms

HTML What is HTML Hyper Text Markup Language is a computer based language used to create WebPages.

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

JavaScript By: A. Mousavi & P. Broomhead SERG, School of Engineering Design, Brunel University, UK

Part A Short Answer (50 marks)

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

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

Indian Institute of Technology Kharagpur. HTML Part III. Prof. Indranil Sen Gupta Dept. of Computer Science & Engg. I.I.T.

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

COMPUTER APPLICATIONS IN BUSINESS FYBMS SEM II

HTTP and HTML. We will use HTML as a frontend to our webapplications, therefore a basic knowledge of HTML is required, especially in forms.

Advanced HTML Scripting WebGUI Users Conference

Table Basics. The structure of an table

SYBMM ADVANCED COMPUTERS QUESTION BANK 2013

HTML TAG SUMMARY HTML REFERENCE 18 TAG/ATTRIBUTE DESCRIPTION PAGE REFERENCES TAG/ATTRIBUTE DESCRIPTION PAGE REFERENCES MOST TAGS

Lecture 08. Tables in HTML. Mr. Mubashir Ali Lecturer (Dept. of Computer Science)

Chapter 4 Creating Tables in a Web Site Using an External Style Sheet

By Ryan Stevenson. Guidebook #2 HTML

Website Development with HTML5, CSS and Bootstrap

Final Examination Semester 1 / Year 2012

Page Layout Using Tables

CITS1231 Web Technologies. HTML Tables and Page Design Issues

CS 350 COMPUTER/HUMAN INTERACTION. Lecture 6

Index. CSS directive, # (octothorpe), intrapage links, 26

Tables *Note: Nothing in Volcano!*

Introduction to using HTML to design webpages

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

The figure below shows the Dreamweaver Interface.

Hyper- Any time any where go to any web pages. Text- Simple Text. Markup- What will you do

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

COMP1000 Mid-Session Test 2017s1

Creating a Website in Schoolwires

Bridges To Computing

Certified HTML5 Developer VS-1029

JavaScript CSCI 201 Principles of Software Development

CSC Web Technologies, Spring HTML Review

Deccansoft Software Services

Slightly more advanced HTML

Dreamweaver Tutorials Working with Tables

Chapter 1 Getting Started with HTML 5 1. Chapter 2 Introduction to New Elements in HTML 5 21

ABOUT WEB TECHNOLOGY COURSE SCOPE:

cwhois Manual Copyright Vibralogix. All rights reserved.

Web Development & Design Foundations with HTML5

ICT IGCSE Practical Revision Presentation Web Authoring

Eng 110, Spring Week 03 Lab02- Dreamwaver Session

COMS 359: Interactive Media

HTML BEGINNING TAGS. HTML Structure <html> <head> <title> </title> </head> <body> Web page content </body> </html>

Name Related Elements Type Default Depr. DTD Comment

Consider the following file A_Q1.html.

Creating a Web Page with HTML

Web Design and Development ACS Chapter 12. Using Tables 11/23/2017 1

Exercise #2: your Profile

Mobile Site Development

CIS 228 (Spring, 2012) Final, 5/17/12

HyperText Markup Language/Tables

HTML. LBSC 690: Jordan Boyd-Graber. October 1, LBSC 690: Jordan Boyd-Graber () HTML October 1, / 29

COMS 359: Interactive Media

CPSC 481: CREATIVE INQUIRY TO WSBF

A. Using technology correctly, so that your site will still function for users who don t have these technologies

COPYRIGHTED MATERIAL. Contents. Chapter 1: Creating Structured Documents 1

Designing for Web Using Markup Language and Style Sheets

HTML 5 Tables and Forms

Chapter 7 Tables and Layout

COM1004 Web and Internet Technology

HTML Tags <A></A> <A HREF=" CNN </A> HREF


HTML. HTML Evolution

Chapter 7 Tables and Layout

Programmazione Web a.a. 2017/2018 HTML5

Perfect Student Midterm Exam March 20, 2007 Student ID: 9999 Exam: 7434 CS-081/Vickery Page 1 of 5

HTML5. HTML5 Introduction. Form Input Types. Semantic Elements. Form Attributes. Form Elements. Month Number Range Search Tel Url Time Week

Tables & Lists. Organized Data. R. Scott Granneman. Jans Carton

Dreamweaver Basics Outline

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

By the end of this section of the practical, the students should be able to:

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

Blackboard staff how to guide Accessible Course Design

Output a HTML Table to file PDF use FPDF

c360 Web Connect Configuration Guide Microsoft Dynamics CRM 2011 compatible c360 Solutions, Inc. c360 Solutions

CHAPTER 2 MARKUP LANGUAGES: XHTML 1.0

<form>. input elements. </form>

COPYRIGHTED MATERIAL. Contents. Chapter 1: Introducing Microsoft Expression Web 1. Chapter 2: Building a Web Page 21. Acknowledgments Introduction


INFS 2150 Introduction to Web Development

Using Adobe Contribute 4 A guide for new website authors

Rich Text Editor Quick Reference

Transcription:

Chapter4: HTML Table and Script page, HTML5 new forms Asst. Prof. Dr. Supakit Nootyaskool Information Technology, KMITL

Objective To know HTML5 creating a new style form. To understand HTML table benefits To build a table design and show on web page To add image, hyperlinks or text on the table cell

Topics Sketching table Table components Adding borders CSS border properties Adjust height and width Padding and spacing Adding span Row spans Nest table Scripting web page Browser windows Solicit and verify user input Server side script Including Script Same script on multiple page

4.63 New style forms in HTML5 When we want to get input data from user, we will use <input>..</input> by typing in <form>..<form> Example <form> </form> <input type= xxx value= yyy > </input>

4.63 New style forms in Button HTML5 When we want to get input data from Image user, we Password will use <input>..</input> by typing in <form>..<form> Example <form> </form> <input type= xxx value= yyy > </input> Type of input data Checkbox File Hidden Ratio Reset Submit Text textarea Display text on webpage

<!DOCTYPE HTML> <html> <head> </head> <body> </body> <meta charset='utf-8'> Check code <form> <input type='button' value='true'> กดป มส <br/> </form> <input type='checkbox' value='1'> เล อกส <br/> <input type='file' value='หาไฟล '> ไฟล ไหน <br/> <input type='hidden' value='ซ อนไว '> ซ อนอย ในcode <br/> Don t forget save as UTF-8

<!DOCTYPE HTML> <html> <head> <meta charset='utf-8'> </head> <body> <form> <input type = 'button' </form> </body> Test button onclick = "alert('hello world');" value = Say alert'> กดป มส <br/>

JS command

<!DOCTYPE HTML> <html> <head> </head> <body> </body> <meta charset='utf-8'> Submit to another page <form action="receiver.html" method="get"> </form> <input type = 'submit' value = 'Say alert'> กดป มส <br/>

method get No data

<!DOCTYPE HTML> <html> <head> </head> <body> </body> <meta charset='utf-8'> Submit to another page <form action="receiver.html" method="get"> </form> <input type = 'submit' name = message value = 'Say alert'> กดป มส <br/>

method get data

Method = get /test/demo_form.asp?name1=value1&name2=val ue2 Some other notes on GET requests: GET requests can be cached GET requests remain in the browser history GET requests can be bookmarked GET requests should never be used when dealing with sensitive data GET requests have length restrictions GET requests should be used only to retrieve data From: http://www.w3schools.com/tags/ref_httpmethods.asp

<!DOCTYPE HTML> <html> <head> </head> <body> </body> <meta charset='utf-8'> <form action="receiver.php" method="get"> <input type = 'submit' </form> Lec4.html name = 'message' value = 'Say alert'> กดป มส <br/> <?php?> receiver.php $m = $_GET["message"]; <!DOCTYPE HTML> <html> <head> <meta charset='utf-8'> </head> <body> <?php echo "Your message:". $m;?> </body>

icounter We will show communication concept of clientserver by icounter. Value = 1 Html Html value=2 php

<!DOCTYPE HTML> <html> <head> <meta charset='utf-8'> </head> <body> <form action="receiver.php" method="get"> <input type = 'submit' name = 'data' value = '1'> กดป มส <br/> </form> </body> lec4.html

<?php $i = $_GET["data"];?> <!DOCTYPE HTML> <html> <head> <meta charset='utf-8'> </head> <body> <form action="receiver.php" method="get"> <input type = 'submit' name = 'data' <?php $i=$i+1; echo "value = ".$i; </form> </body>?> > กดป มส <br/> receiver.php

Change data = 4 Press enter

4.0 Specific of Tables Benefit of table Using tables to arrange items on your web page. Turning border off, users can t see these tables A couple of way to create table Traditional (ho-hum) method Table doesn t resize when user resize their browser windows Fixed size Presentation-focus(wow) method Table resize itself when users resize their browser Percentage size P176

4.0 Specific of tables A table generally consists in three basic elements Borders Cell Cell span (Combine or merge cell)

4.1 Sketching your table 1. Grab a sheet of paper and a pencil so you can sketch out your idea 2. Evaluate what to include in your web and decide on the overall layout 1. How many column and row you need? 2. The width of the table and cells 3. Weather to make any cell span rows or columns 3. Draw it on a paper P179

P181 4.2 Constructing basic tables Component Table: <table> attribute border= 0 1, bgcolor= black Table row: <tr> Table data cell: Table header: <td> data </td> <th> text </th> CSS control <div class = name > STEP1: start table <table>. </table> STEP2: how many rows: two? <table border = 1 > <\table> <tr> </tr> <tr> </tr>

<table border = "1" bgcolor = "green"> <tr> <td> contents </td> </tr> <tr> <td> contents </td> <td> contents </td> </tr> </table> <table border = "1" bgcolor = "green"> <tr> <td colspan="2"> contents </td> </tr> <tr> <td> contents </td> </tr> </table> <td> contents </td>

4.3 Adjusting height and width P189 Most browsers determine the width of cell by looking the content of the cell. If you set width-limited at 100pixels and the picture size is 200pixels, the browser will expand as far as picture size. Text may expand and distort the layout Attribute of width and height can be used in <table> and <td> Width width = value Height height = value The value is number of the pixel.

4.4 Shifting alignment P195 The table or image will be controlled their placement in the browser windows by using alignment commands Horizontal alignment align = right left center justify char Cellpadding expands cell cellpadding = value Vertical alignment valign = top bottom middle baseline

<table border = "1" > <tr> <td colspan="2" align="justify"> this is the first table. it is easy to plan and write the code. the_table_contains_a lot_of_information to support user.</td> </tr> <tr> </tr> </table> <td width="200"> contents </td> <td width = "200"> contents </td>

<table border = "1" cellpadding="20" > <tr> <td colspan="2" align="char"> this is the first table. it is easy to plan and write the code. the_table_contains_a lot_of_information to support user.</td> </tr> <tr> </tr> </table> <td width="200" > contents </td> <td width = "200"> contents </td>

<html> <body> <table border= border > <tr> </tr> <th>alignment</th> <th>top</th> <th>baseline</th> <th>not align</th> <th>center</th> <th>bottom</th> <tr align= center > </tr> </table> </body> </html> <th><h1>baseline <br />Another line</h1></th> <td valign="top">aayy</td> <td valign="baseline">_aayy_</td> <td>_aayy_</td> <td valign="center">aayy</td> <td valign="bottom">aayy</td>

4.5 Adding spans Spanning table is the arrangement element of table shown on the web. The extend horizontally cell colspan = value The extending vertically cell rowspan = value P198

4.6 Nesting table To nest a table, simply add the <table> element within a <td> element. Draw the table from the code on right hand side

SCRIPT WEB PAGE

4.7 Script webpage Script language The script language changes from static web page into dynamic web page that can solicit and respond to user input. Script? Scripts are mini-program that is create to check or support a small solution. The script is usually interpreter (not change the source to byte code), for example language, JavaScript VB script Unix shell script Windows batch file Apple script Etc..

4.7 Script webpage (2) JavaScript is not Java Java is descendent of the C and C++ programming language. Java developed by Sun Microsystems. The JavaScript programming language, developed by Netscape, Inc., is not part of the Java platform. JavaScript, does not create applets or stand-alone applications. In its most common form today, JavaScript resides inside HTML documents, and can provide levels of interactivity to web pages that are not achievable with simple HTML. Listed are key differences between the Java and JavaScript. Java is an OOP programming language while Java Script is an OOP scripting language. Java creates applications that run in a virtual machine or browser while JavaScript code is run on a browser only. Java code needs to be compiled while JavaScript code are all in text. They require different plug-ins. Reference: http://www.java.com/en/download/faq/java_javascript.xml

4.8 Work with browser windows JavaScript can tell your browser to open and close windows. Command <script language = javascript type= text/javascript > function newwindows() { myvar = window.open( image.jpg, picname, width=300,height=250 ) } P218

4.9 Solicit and verify user input A common use for JavaScript is to verify that user have filled out all the require field in a form before the browser actually submits the form to the form-processing program.

LAB3 CHECK STUDENT ID

Lab3.1 Enter student id Open text edit and write code (below) Save the code to /lab3/lab3_1.html Check your code, open browser and type http://localhost/lab3/lab3_1.html <html> <body> <form method="get" action="lab3_2.html" <p> Student ID <input type="text" name="id" /> <br/> </p> </form> </body> </html> Name <input type="text" name="name" /> <br/> <input type="button" value="say hi"/> <input type="submit" value="submit to the action file"/>

Check Lab3.1 Push button Say hi No response!! Push button Submit to the action file

Lab3.2 Modify lab3.1 by adding more code (below) <html> <body> <script language="javascript" type="text/javascript"> function sayhello(message) { alert(message) } </script> <form method="get" action="lab3_3.html" <p> Student ID <input type="text" name="id" /> <br/> Name <input type="text" name="name" /> <br/> <input type="button" value="say hi" onclick="sayhello('hi myfriend')"/> <input type="submit" value="submit to the action file"/> </p> </form> </body> </html>

Check Lab3.2 Push button Say hi Push button Submit to the action file

Lab3.3 Write code (below) and check output <html> <body> <script type="text/javascript"> </script> </body> </html> document.write("<p>" + Date() + "</p>"); document.write( Hello JavaScript</p> This is the first program");

Lab3.4 Write code (below) and check output <HTML> <HEAD> <TITLE> New Document </TITLE> <script type="text/javascript"> function answer(){ var textbox = document.getelementbyid('mytext'); if(textbox.value!= "") alert("your name: " + textbox.value) else alert("you don't type login name") } </script> </HEAD> <BODY> Login name:<input type='text' id='mytext'/> <br/> <input type='button' onclick='answer()' value='check login' /> </BODY> </HTML>