Java Script Learning 6

Source: Internet
Author: User
Tags html form

JavaScript Form Validation

HTML form validation can be done through JavaScript.

Automatic validation of HTML forms

HTML form validation can also be done automatically through a browser. Nternet Explorer 9 and earlier IE browsers do not support forms automatic validation.

Data validation

Data validation is used to ensure that the data entered by the user is valid.

Typical data validation is:

    • Does the required field have input?
    • Does the user enter legitimate data?
    • Did you enter text in the Number field?

In most cases, data validation is used to ensure that users enter data correctly.

Data validation can be defined in different ways and invoked in several ways.

Server -side data validation is verified after the data is submitted to the servers.

Client data validation side validation is done on the browser before the data is sent to the server.

HTML Constraint Validation

HTML5 adds a new way to validate HTML forms: Constraint validation (constraint validation).

Constraint validation is an algorithm that the browser uses to implement validation when a form is submitted.

HTML constraint validation is based on:

  • HTML Input Properties
  • CSS pseudo-Class selector
  • DOM Properties and MethodsJavaScript Form Validation

    JavaScript can be used to validate these input data in an HTML form before the data is sent to the server.

    form data often requires JavaScript to verify its correctness:

    • Verify that the form data is empty?
    • Verify that the input is a correct email address?
    • Verify that the date is entered correctly?
    • Verify that the form input is a digital type? Required (or required) items

      The following function is used to check whether the user has filled out the required (or required) items in the form. If the required or required option is empty, the warning box pops up, and the return value of the function is false, otherwise the return value of the function is true (meaning there is no problem with the data):

      E-mail verification

      The following function checks whether the input data conforms to the basic syntax of an e-mail address.

      This means that the data entered must contain the @ symbol and the dot (.). At the same time, @ cannot be the first character of the email address and must have at least one dot after @

      JavaScript Validation API Constraints Validate DOM methods what is JSON?
      • JSON English full name JAvaScript Object Notation
      • JSON is a lightweight format for data interchange.
      • JSON is a separate language *
      • JSON is easy to understand.

        JSON is the format used to store and transfer data.

        JSON is typically used for service-side delivery of data to a Web page. JSON uses JavaScript syntax, but the JSON format is just a text.
        Text can be read by any programming language and passed as a data format.

        After JSON is formatted as a JavaScript object

        The JSON format is syntactically identical to the code that creates JavaScript objects.

        Because they are very similar, JavaScript programs can easily convert JSON data into JavaScript objects.

        After JSON is formatted as a JavaScript object

        The JSON format is syntactically identical to the code that creates JavaScript objects.

        Because they are very similar, JavaScript programs can easily convert JSON data into JavaScript objects.

        After JSON is formatted as a JavaScript object

        The JSON format is syntactically identical to the code that creates JavaScript objects.

        Because they are very similar, JavaScript programs can easily convert JSON data into JavaScript objects.

        After JSON is formatted as a JavaScript object

        The JSON format is syntactically identical to the code that creates JavaScript objects.

        Because they are very similar, JavaScript programs can easily convert JSON data into JavaScript objects.

        After JSON is formatted as a JavaScript object

        The JSON format is syntactically identical to the code that creates JavaScript objects.

        Because they are very similar, JavaScript programs can easily convert JSON data into JavaScript objects.

        After JSON is formatted as a JavaScript object

        The JSON format is syntactically identical to the code that creates JavaScript objects.

        Because they are very similar, JavaScript programs can easily convert JSON data into JavaScript objects.

        After JSON is formatted as a JavaScript object

        The JSON format is syntactically identical to the code that creates JavaScript objects.

        Because they are very similar, JavaScript programs can easily convert JSON data into JavaScript objects.

        After JSON is formatted as a JavaScript object

        The JSON format is syntactically identical to the code that creates JavaScript objects.

        Because they are very similar, JavaScript programs can easily convert JSON data into JavaScript objects.

        JavaScript Code Specification

        Code specifications typically include the following:

          • Naming rules for variables and functions
          • Whitespace, indentation, usage rules for annotations.
          • Other common specifications ...

        The code of the specification can be easier to read and maintain.

        Code specifications are generally defined before development and can be negotiated with your team members.

        JavaScript Code Specification

        Code specifications typically include the following:

          • Naming rules for variables and functions
          • Whitespace, indentation, usage rules for annotations.
          • Other common specifications ...

        The code of the specification can be easier to read and maintain.

        Code specifications are generally defined before development and can be negotiated with your team members.

        JavaScript Code Specification

        Code specifications typically include the following:

          • Naming rules for variables and functions
          • Whitespace, indentation, usage rules for annotations.
          • Other common specifications ...

        The code of the specification can be easier to read and maintain.

        Code specifications are generally defined before development and can be negotiated with your team members.

        JavaScript Code Specification

        Code specifications typically include the following:

          • Naming rules for variables and functions
          • Whitespace, indentation, usage rules for annotations.
          • Other common specifications ...

        The code of the specification can be easier to read and maintain.

        Code specifications are generally defined before development and can be negotiated with your team members.

        JavaScript Code Specification

        Code specifications typically include the following:

          • Naming rules for variables and functions
          • Whitespace, indentation, usage rules for annotations.
          • Other common specifications ...

        The code of the specification can be easier to read and maintain.

        Code specifications are generally defined before development and can be negotiated with your team members.

        JavaScript Code Specification

        Code specifications typically include the following:

          • Naming rules for variables and functions
          • Whitespace, indentation, usage rules for annotations.
          • Other common specifications ...

        The code of the specification can be easier to read and maintain.

        Code specifications are generally defined before development and can be negotiated with your team members.

        JavaScript Code Specification

        Code specifications typically include the following:

          • Naming rules for variables and functions
          • Whitespace, indentation, usage rules for annotations.
          • Other common specifications ...

        The code of the specification can be easier to read and maintain.

        Code specifications are generally defined before development and can be negotiated with your team members.

        Accessing HTML elements using JavaScript

        A bad HTML format could lead to JavaScript execution errors.

        File name extension

        The HTML file suffix can be . HTML (or R . htm).

        The CSS file suffix is . css .

        The JavaScript file suffix is . js .

        File name extension

        The HTML file suffix can be . HTML (or R . htm).

        The CSS file suffix is . css .

        The JavaScript file suffix is . js .

Java Script Learning 6 (RPM)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.