Ionic Form Validator
clone this repo into your project and import IonFormValidatorModule
into your page module
Include your directive into the same tag with [FormGroup]
<form [formGroup]="validator" formGroupValidator>
<div class="ion-padding-vertical">
public validator = this.formBuilder.group({
username: ['', [ValidationService.required]],
password: ['', [
ValidationService.required,
ValidationService.startsWith("08")
]]
});
The field under validation must be present in the input data and not empty.
The field under validation must be entirely alphabetic characters.
The field under validation must be entirely alpha-numeric characters.
The field under validation must be 6 or more character and must include numeric character.
The field under validation must have a matching field of foo_confirmation
. For example, if the field under validation is password, a matching password_confirmation
field must be present in the input.
The field under validation must be formatted as an e-mail address.
The field under validation must be numeric.
The field under validation must be formatted as an phone number.
The field under validation must have a minimum value. Strings, numerics, arrays, and files are evaluated in the same fashion as the size rule.
The field under validation must be less than or equal to a maximum value. Strings, numerics, arrays, and files are evaluated in the same fashion as the size rule.
The field under validation must be more than specified value
The field under validation must start with one of the given values.
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE.md file for details