I have developed a registration form to allow users to signup for a new account.
in the registration form in Ionic2 and I have to validate some values in the form before submit, one of the values (Full Name) may include either English or Arabic Characters
I used form validation concept as following:
this.personalInfoForm = formBuilder.group({
txtFullName: ['', Validators.compose([Validators.minLength(6), Validators.maxLength(30), Validators.pattern('[a-zA-Z ]*'), Validators.required])],
txtNickname: ['', Validators.compose([Validators.minLength(6), Validators.maxLength(30), Validators.pattern('[a-zA-Z ]*'), Validators.required])],
SGender: ['', Validators.required],
txtCommercialName: ['', Validators.compose([Validators.minLength(6), Validators.maxLength(30), Validators.pattern('[a-zA-Z ]*')])],
txtDateOfBirth: ['', Validators.required],
});
my problem is that the validator only accept English characters and when user enter Arabic characters the validator doesn't recognize it as a valid value so it doesn't accept it
Are there any pattern to make the validator accept Arabic characters, English characters, space