Categories

Friday, November 22, 2024
#919814419350 therichposts@gmail.com
Angular7Javascript

Angular 7 Form Validation Methods for Different Input Fields

Hello to all, welcome to therichpost.com. In this post, I will tell you, Angular 7 Form Validation Methods for Different Input Fields.

If you are new in Angular 7, then please check old posts related to Angular 7.

In this post, I will give you tell some form input fields validations tricks In Angular 7.

ngOnInit() {
          this.formdata = new FormGroup({
                 //Number Validations and Min Max Validation
        	mobile_number : new FormControl("", [Validators.required, Validators.pattern("^[0-9]*$"), Validators.minLength(6), Validators.maxLength(10)]),

                 //Email Validation
        	email : new FormControl("", [Validators.required, Validators.email]),

                //Min lenght Validation
        	password : new FormControl("",  [Validators.required, Validators.minLength(5)]),

                //Empty Field Validation
        	package_type : new FormControl("", Validators.required),

       });

   
  }

 

For more information, please comment below or ask questions.

Harjas,

Thank you

therichpost
the authortherichpost
Hello to all. Welcome to therichpost.com. Myself Ajay Malhotra and I am freelance full stack developer. I love coding. I know WordPress, Core php, Angularjs, Angular 19, MedusaJs, Next.js, Bootstrap 5, Nodejs, Laravel, Codeigniter, Shopify, Squarespace, jQuery, Google Map Api, Vuejs, Reactjs, Big commerce etc.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.