Tuesday, 20 January 2015

Form Validations in HTML5


Different type of validation for HTML5:

    1. Required Attribute: It is used when the value before submission of a form in not filled.
    It is sometimes known as Mandatory or Compulsory field.

    Use of "required" attribute.
    Example:

        <form action="" method="post">
        Name:<br>
        <input type="text" name="name" required>
        <br>
        Age:<br>
        <input type="text" name="age" required><br>
        Email:<br><input type="email" name="email" required placeholder="Enter a valid email address"><br>
        Website:<br><input type="url" name="website" required pattern="https?://.+"><br>
        <input type="submit" />
        </form><br>

To read complete information about Form Validations in HTML5 please visit FindNerd. As it is an effective technology forum, so here you can also ask questions & look for various programming queries along with their solutions including android, php, java, c programming questions and answers etc.

No comments:

Post a Comment