Ebook Mastering HTML5 Forms

Mastering HTML5
Mastering HTML5

Download

THÔNG TIN TÀI LIỆU

Nhà xuất bản Packt Publishing
Tác giả Gaurav Gupta
Số trang 148
Ngày xuất bản 2013
File PDF

NỘI DUNG TÀI LIỆU
Chapter 1: Forms and Their Signifcance 7
Understanding web forms 7
Benefts 8
HTML versus HTML5 forms 9
The form types, elements, and attributes 9
The types 10
The elements 14
The attributes 15
Building an HTML5 form 20
Guidelines 29
Summary 30

Chapter 2: Validation of Forms 31
Form validation 31
Client-side form validation 32
Server-side form validation 33
HTML5 form validation 34
Code 1 – validating a textbox using JavaScript 34
Code 2 – validating a textbox using HTML5

controls 35
Constraint validations 36
HTML5 constraint validation APIs 36
The validity object 36
The checkValidity method 37
The setCustomValidity() method 38
The willValidate attribute 40
The validationMessage attribute 41
The patternMismatch property 42
The customError property 43
The rangeOverflow property 44
The rangeUnderflow property 45
The stepMismatch property 47
The tooLong property 48
The typeMismatch property 49
The valueMissing property 50
The valid property 51
Error messages 54
Summary 55

Chapter 3: Styling the Forms 57
CSS3 for web forms 57
Selectors and pseudo-selectors 58
Backgrounds 60
The background-clip property 60
Syntax 60
Values 60
The background-origin property 61
Syntax 61
Values 61
The background-size property 61
Syntax 61
Values 61
The background-color property 62
The background-repeat property 62
The background-attachment property 62
Borders 63
The border-radius property 63
Syntax 63
Values 63
The box-shadow property 63
Syntax 64
Values 64
The border-image property 64
Syntax 64
Values 64
Text effects 65
The text-shadow property 65
Syntax 65
The word-wrap property 65
Syntax 65
Values 66
Fonts 66
The @font-face rule 66
Syntax 67
Font descriptors 67
The src font descriptor 67
The font-style font descriptor 67
The font-stretch font descriptor 67
The font-family font descriptor 68
The unicode-range font descriptor 68
The font-weight descriptor 68
Gradients 68
Syntax 68
Values 68
Styling the forms 69
Guidelines 78
Summary 78

Chapter 4: Connection with Database 79
PHP 79
Syntax 80
Form handling 80
The GET method 80
The POST method 81
The flter method 82
Validating user input data 84
Sanitizing user input data 85
The FILTER_CALLBACK flter 85
Filter multiple inputs 86
MySQL 87
MySQL for PHP 88
MySQL-PHP connectivity 88
Open a connection to the MySQL server 89
Close a connection 89
Create or select a database 90
Create a database 90
Select a database 90
Create a table 90
Primary keys 91
Spoofng and forging forms 92
Forging HTTP requests 92
Spoofng submissions 93
Shared secrets 94
Setting expectations 95
Linking a form to a server 95
Summary 102

Chapter 5: Responsive Web Forms 103
Responsive design 103
Google’s view about responsive design 104
Benefts of using responsive design 104
How responsive design works 105
Screen resolutions 106
Viewport 106
Media queries 107
Media types 107
Internal media query 108
External media query 109
Media features 109
Different screen resolutions 110
Small screen devices 111
High resolution displays of Apple mobile devices 111
Devices in landscape and portrait modes 113
Fluid grids 113
Fluid grid generators 114
960 grid system 115
Bootstrap 115
Adaptive images 116
Features 117
How it works 117
Customization 118
Making our form responsive 118
Limitations 124
Guidelines 125
Summary 126
Index 127

Be the first to comment

Leave a Reply

Your email address will not be published.

*