Mastering HTML5 Forms


Mastering HTML5 Forms
eBook: $17.99
Formats: PDF, PacktLib, ePub and Mobi formats
$15.29
save 15%!
Print + free eBook + free PacktLib access to the book: $47.98    Print cover: $29.99
$29.99
save 37%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Overview
Table of Contents
Author
Support
Sample Chapters
  • Enhance the look and feel of your form
  • Optimize your user experience for any device
  • Utilize HTML5’s brand new form elements

Book Details

Language : English
Paperback : 148 pages [ 235mm x 191mm ]
Release Date : November 2013
ISBN : 1782164669
ISBN 13 : 9781782164661
Author(s) : Gaurav Gupta
Topics and Technologies : All Books, Web Development, Open Source

Table of Contents

Preface
Chapter 1: Forms and Their Significance
Chapter 2: Validation of Forms
Chapter 3: Styling the Forms
Chapter 4: Connection with Database
Chapter 5: Responsive Web Forms
Index
  • Chapter 1: Forms and Their Significance
    • Understanding web forms
      • Benefits
    • HTML versus HTML5 forms
    • The form <input> types, elements, and attributes
      • The <form> <input> types
      • The <form> elements
      • The <form> attributes
    • Building an HTML5 form
    • Guidelines
    • Summary
    • Chapter 2: Validation of Forms
      • Form validation
        • Client-side form validation
        • Server-side form validation
      • HTML5 form validation
        • Code 1 – validating a textbox using JavaScript
        • Code 2 – validating a textbox using HTML5 <form> controls
      • Constraint validations
        • HTML5 constraint validation APIs
          • The validity object
          • The checkValidity method
          • The setCustomValidity() method
          • The willValidate attribute
          • The validationMessage attribute
          • The patternMismatch property
          • The customError property
          • The rangeOverflow property
          • The rangeUnderflow property
          • The stepMismatch property
          • The tooLong property
          • The typeMismatch property
          • The valueMissing property
          • The valid property
      • Error messages
      • Summary
      • Chapter 3: Styling the Forms
        • CSS3 for web forms
        • Selectors and pseudo-selectors
        • Backgrounds
          • The background-clip property
            • Syntax
            • Values
          • The background-origin property
            • Syntax
            • Values
          • The background-size property
            • Syntax
            • Values
          • The background-color property
          • The background-repeat property
          • The background-attachment property
          • Borders
          • The border-radius property
            • Syntax
            • Values
          • The box-shadow property
            • Syntax
            • Values
          • The border-image property
            • Syntax
            • Values
        • Text effects
          • The text-shadow property
            • Syntax
          • The word-wrap property
            • Syntax
            • Values
        • Fonts
          • The @font-face rule
            • Syntax
          • Font descriptors
            • The src font descriptor
            • The font-style font descriptor
            • The font-stretch font descriptor
            • The font-family font descriptor
            • The unicode-range font descriptor
            • The font-weight descriptor
        • Gradients
          • Syntax
          • Values
        • Styling the forms
        • Guidelines
        • Summary
        • Chapter 4: Connection with Database
          • PHP
            • Syntax
            • Form handling
              • The GET method
              • The POST method
            • The filter method
              • Validating user input data
              • Sanitizing user input data
              • The FILTER_CALLBACK filter
              • Filter multiple inputs
          • MySQL
            • MySQL for PHP
            • MySQL-PHP connectivity
              • Open a connection to the MySQL server
              • Close a connection
            • Create or select a database
              • Create a database
              • Select a database
            • Create a table
            • Primary keys
          • Spoofing and forging forms
            • Forging HTTP requests
            • Spoofing submissions
            • Shared secrets
            • Setting expectations
          • Linking a form to a server
          • Summary
          • Chapter 5: Responsive Web Forms
            • Responsive design
              • Google's view about responsive design
              • Benefits of using responsive design
              • How responsive design works
              • Screen resolutions
              • Viewport
            • Media queries
              • Media types
                • Internal media query
                • External media query
              • Media features
              • Different screen resolutions
                • Small screen devices
                • High resolution displays of Apple mobile devices
                • Devices in landscape and portrait modes
            • Fluid grids
              • Fluid grid generators
              • 960 grid system
              • Bootstrap
            • Adaptive images
              • Features
              • How it works
              • Customization
            • Making our form responsive
            • Limitations
            • Guidelines
            • Summary

            Gaurav Gupta

            Gaurav Gupta is a budding, young IT professional with a large amount of exposure working on web and cross-platform application development. He is a versatile developer and is always keen to learn new technologies that are updated in this domain. His passion for his work makes him stand apart from other developers. A graduate in Computer Science, he currently works for a reputed CMMI Level 5 company and has developed several web and mobile applications for internal use. Gaurav is a native of Chandigarh, India, and he currently lives in Pune, India.
            Sorry, we don't have any reviews for this title yet.

            Code Downloads

            Download the code and support files for this book.


            Submit Errata

            Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.


            Errata

            - 2 submitted: last submission 22 Nov 2013

            Errata type: Others | Page number: 18

            The line: <input type= "file" name= "image"multiple>

            Should be:

            <input type= "file" name= "image" multiple>

             

             

             

            Errata type: code | Page number: 19

            The line: <input type= "text" name= "city"required>

            Should be:

            <input type= "text" name= "city" required>

             

             

            Errata type: code | Page number: 20

            In the code

            html {

            background-color: #333;

            margin: 0px;

            padding: 0px;

            Should be:

            html{

            background-color: #333;

            margin: 0px;

            padding: 0px;

            Errata type: code | Page number: 84

              <?php
              if(!filter_has_var($_GET["url"l))
              {
              echo("Input type is not present");
              }
              else
              {
              if (!filter_var($_GET["url"l, FILTER_VALIDATE_URL))
              {
              echo "Entered URL is invalid";
              }
              else
              {
              echo "Entered URL is valid";
              }
              }
            ?>

            Should be:

            <?php
              if(!filter_has_var($_GET["url"l))
              {
              echo("Input type is not present");
              }
              else
              {
              if (!filter_var($_GET["url"l, FILTER_VALIDATE_URL))
              {
              echo "Entered URL is invalid";
              }
              else
              {
              echo "Entered URL is valid";
              }
              }
            ?>

            Sample chapters

            You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

            Frequently bought together

            Mastering HTML5 Forms +    Python 2.6 Text Processing: Beginners Guide =
            50% Off
            the second eBook
            Price for both: £20.44

            Buy both these recommended eBooks together and get 50% off the cheapest eBook.

            What you will learn from this book

            • Get to grips with the new HTML5 form elements and attributes
            • Add client-side validation to your forms using HTML5 attributes
            • Discover form validation constraints and the supported APIs
            • Style your forms using CSS3
            • Prevent spoofing and forging of the forms
            • Utilize PHP and MySQL to store information in databases
            • Understand responsive design techniques

            In Detail

            HTML5 has given web developers the ability to easily develop sites and applications which, previously, were extremely time consuming. Now, they can not only build visually stunning forms and web pages, but can also increase the scope of their applications, as well as collect valuable user inputs and data through customized forms.

            This practical guide will teach you how to create responsive forms, and how to link them to the database. This will enable you to take advantage of the power behind HTML5 elements for building forms, and make the user interfaces attractive and more interactive.

            Explore the benefits of web forms, and learn how to create them using new HTML5 form elements. This guide will take you through a number of clear, practical examples that will help you to take advantage of the forms built and customized using HTML5 and related technologies, quickly and painlessly. Your ability to build responsive forms will be enhanced throughout the book.
            You will also learn about the necessity of validations, CSS3 properties for improving the look of the form, and how to link the form to the server. Lastly, you will learn to make the standard forms responsive by making them compatible with desktops and mobile devices.

            Approach

            This tutorial will show you how to create stylish forms, not only visually appealing, but interactive and customized, in order to gather valuable user inputs and information.

            Who this book is for

            Enhance your skills in building responsive and dynamic web forms using HTML5, CSS3, and related technologies. All you need is a basic understanding of HTML and PHP.

            Code Download and Errata
            Packt Anytime, Anywhere
            Register Books
            Print Upgrades
            eBook Downloads
            Video Support
            Contact Us
            Awards Voting Nominations Previous Winners
            Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
            Resources
            Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software