27
1 Web Page Technologies

1 Web Page Technologies 2 In This Lecture You Will Learn About … Forms Fancy Forms Tables Fancy Tables

Embed Size (px)

Citation preview

Page 1: 1 Web Page Technologies 2 In This Lecture You Will Learn About … Forms Fancy Forms Tables Fancy Tables

1

Web Page Technologies

Page 2: 1 Web Page Technologies 2 In This Lecture You Will Learn About … Forms Fancy Forms Tables Fancy Tables

2

In This Lecture You Will Learn About … Forms Fancy Forms Tables Fancy Tables

Page 3: 1 Web Page Technologies 2 In This Lecture You Will Learn About … Forms Fancy Forms Tables Fancy Tables

3

Forms Modern web pages allow you to submit

data via forms Anywhere you enter text or select an

option or press a button is a form

Page 4: 1 Web Page Technologies 2 In This Lecture You Will Learn About … Forms Fancy Forms Tables Fancy Tables

4

Forms

<form>

</form>

The form tag …

… has 2 compulsory attributes

<form method = “post” action = “mailto: [email protected]>

</form>

Page 5: 1 Web Page Technologies 2 In This Lecture You Will Learn About … Forms Fancy Forms Tables Fancy Tables

5

Forms Let’s develop the XHTML for this form

Page 6: 1 Web Page Technologies 2 In This Lecture You Will Learn About … Forms Fancy Forms Tables Fancy Tables

6

Forms We start with the form tag

<form method = “post” action = “mailto: [email protected]>

</form>

Then we add the text box

<input type = “text” name = “usersName” size = 20 maxlength = 30 />

Enter Your Name

</br>

Page 7: 1 Web Page Technologies 2 In This Lecture You Will Learn About … Forms Fancy Forms Tables Fancy Tables

7

Forms Then we add the submit button

<input type = “submit” value = “Press Here to Submit Your Name” />

And finally the reset button

<input type = “reset” value = “Reset” />

Page 8: 1 Web Page Technologies 2 In This Lecture You Will Learn About … Forms Fancy Forms Tables Fancy Tables

8

Forms

<form method = "post" action = "mailto: [email protected]">

<input type = "text" name = "UsersName" size = "20" maxlength = "30" />

Enter Your Name <br />

<input type = "submit" value = "Press Here to Submit Name" />

<input type = "reset" value = "Reset" />

</form>

Page 9: 1 Web Page Technologies 2 In This Lecture You Will Learn About … Forms Fancy Forms Tables Fancy Tables

9

Forms You can create more complex forms eg those in on-line tutorial

Page 10: 1 Web Page Technologies 2 In This Lecture You Will Learn About … Forms Fancy Forms Tables Fancy Tables

10

Forms

<input type = "text" name = "firstName" size = "20" maxlength = "30" />

First Name <br />

<input type = "text" name = "secondName" size = "20" maxlength = "30" />

Second Name <br />

<input type = "text" name = "emailaddress" size = "20" maxlength = "30" />

e-mail address <br />

The text boxes

Page 11: 1 Web Page Technologies 2 In This Lecture You Will Learn About … Forms Fancy Forms Tables Fancy Tables

11

Forms

<select name = "residesIn">

<option> Scotland </option>

<option> England </option>

<option> N. Ireland </option>

<option> Wales </option>

<option> Other </option>

</select>

Where do you live?

<br /> <br />

The Select Field

Page 12: 1 Web Page Technologies 2 In This Lecture You Will Learn About … Forms Fancy Forms Tables Fancy Tables

12

Forms

What is your age category? <br />

<input type = "radio" name = "ageCategory" value = "underFive" />

Under 5 <br />

<input type = "radio" name = "ageCategory" value = "sixToTen" />

6 - 10 <br />

<input type = "radio" name = "ageCategory" value = "elevenToEighteen" />

11 - 18 <br />

<input type = "radio" name = "ageCategory" value = "overEighteen" />

Over 18 <br /> <br />

The Radio Buttons

Page 13: 1 Web Page Technologies 2 In This Lecture You Will Learn About … Forms Fancy Forms Tables Fancy Tables

13

Forms The Check Boxes

Which of the following types of books do you read? (tick all that apply) <br />

<input type = "checkbox" name = "gardening" value = "gardening" /> Gardening <br />

<input type = "checkbox" name = "cooking" value = "cooking" /> Cooking <br />

<input type = "checkbox" name = "sport" value = "sport" /> Chick Lit <br />

<input type = "checkbox" name = "romance" value = "romance" /> Romantic Fiction <br />

<input type = "checkbox" name = "potter" value = "potter" />

Harry Potter and other similar types of book <br /><br />

Page 14: 1 Web Page Technologies 2 In This Lecture You Will Learn About … Forms Fancy Forms Tables Fancy Tables

14

Forms The File

Field

Attach a file containing your 10 favourite books

<input type = "file" name = "favbooksfile" />

<br /> <br />

Page 15: 1 Web Page Technologies 2 In This Lecture You Will Learn About … Forms Fancy Forms Tables Fancy Tables

15

Forms

The Text AreaYour comments and suggestions are always useful <br />

<textarea name = "comments" cols = "50" rows = "6">

Please type you comments or suggestions here

</textarea>

<br /> <br />

Page 16: 1 Web Page Technologies 2 In This Lecture You Will Learn About … Forms Fancy Forms Tables Fancy Tables

16

Forms The Submit/Reset Buttons

<input type = "submit" value = "Press Here to Submit Name" />

<input type = "reset" value = "Reset" />

Page 17: 1 Web Page Technologies 2 In This Lecture You Will Learn About … Forms Fancy Forms Tables Fancy Tables

17

Tables Creating tables is easy

Page 18: 1 Web Page Technologies 2 In This Lecture You Will Learn About … Forms Fancy Forms Tables Fancy Tables

18

Tables The table tag …

<table>

</table>

… has an optional attribute

<table border = “1”>

</table>

Page 19: 1 Web Page Technologies 2 In This Lecture You Will Learn About … Forms Fancy Forms Tables Fancy Tables

19

Tables You can add a caption

<table border = “1”>

<caption> e-mail Address List </caption>

</table>

Page 20: 1 Web Page Technologies 2 In This Lecture You Will Learn About … Forms Fancy Forms Tables Fancy Tables

20

Tables The head of the table <thead> has one

row <tr><table border = “1”>

<caption> e-mail Address List </caption>

<thead>

<tr>

</tr>

</thead>

</table>

Page 21: 1 Web Page Technologies 2 In This Lecture You Will Learn About … Forms Fancy Forms Tables Fancy Tables

21

Tables That row contains two headings <th>

<table border = “1”>

<caption> e-mail Address List </caption>

<thead>

<tr>

<th> Name </th>

<th> e-mail Address </th>

</tr>

</thead>

</table>

Page 22: 1 Web Page Technologies 2 In This Lecture You Will Learn About … Forms Fancy Forms Tables Fancy Tables

22

Tables The rest of the table is in the body of the

table <tbody>

<table border = “1”>

<caption> e-mail Address List </caption>

<thead> <tr> <th> Name </th> <th> e-mail Address </th> </tr> </thead>

<tbody>

</tbody>

</table>

Page 23: 1 Web Page Technologies 2 In This Lecture You Will Learn About … Forms Fancy Forms Tables Fancy Tables

23

Tables The body has three rows

<table border = “1”>

<caption> e-mail Address List </caption>

<thead> <tr> <th> Name </th> <th> e-mail Address </th> </tr> </thead>

<tbody>

<tr>

</tr>

<tr>

</tr>

<tr>

</tr>

</tbody>

</table>

Page 24: 1 Web Page Technologies 2 In This Lecture You Will Learn About … Forms Fancy Forms Tables Fancy Tables

24

Tables Each row has two data items <td>

<table border = “1”>

<caption> e-mail Address List </caption>

<thead> <tr> <th> Name </th> <th> e-mail Address </th> </tr> </thead>

<tbody>

<tr> <td> Fred Bloggs </td> <td> [email protected] </td> </tr>

<tr> <td> Joe Soap </td> <td> [email protected] </td> </tr>

<tr> <td> Mickey Mouse </td> <td> [email protected] </td> </tr>

</tbody>

</table>

Page 25: 1 Web Page Technologies 2 In This Lecture You Will Learn About … Forms Fancy Forms Tables Fancy Tables

25

Tables Combine

earlier XHTML with tables

Page 26: 1 Web Page Technologies 2 In This Lecture You Will Learn About … Forms Fancy Forms Tables Fancy Tables

26

Hot Spots Use tutorial to study hot spots They will be assessed !

Page 27: 1 Web Page Technologies 2 In This Lecture You Will Learn About … Forms Fancy Forms Tables Fancy Tables

27

Lecture Slides

www.dcs.napier.ac.uk/~owens/wpt/lectures/wptlecture3.ppt