Angularjs Review------Form Validation

Source: Internet
Author: User

In Angularjs, you can use the HTML5 form verification feature with your own validation instructions, which describes the core functionality used.

  1. With form validation, first make sure that each control of the form has a Name property
  2. If you want to block the browser's default validation behavior for forms, you can add novalidate tags to the form elements.

Required, just add the HTML5 tag to the input field element required

Minimum length; Use the ANGULARJS directive ng-minlength= "{number}" on the input field

Maximum length; Use the ANGULARJS directive ng-maxlength= "{number}" on the input field

pattern matching; use ng-pattern= "[a-za-z]" to ensure that the input matches the specified regular expression

e-mail, as long as the type of input is set to email

Set the type of input to number

URL, verify input is URL address, set input type to URL

Angularjs Review------Form Validation

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.