Open pathum-kalhan opened 6 years ago
Maybe update mobileRegx, so it allows empty string/null/undefined? I am not so good at regex, so not sure what mobileRegx currently doing, but maybe its test return false if contact_number is empty?
Edit:
Try:
return value ? mobileRegx.test(value) : true;
I have a vuelidate custom validator for validate the mobile number.
In my validation object
I disable the
create customer
button if something wrong in the validations.contact_number
is not a must to create a customer. But the problem here is$v.$invalid
is always true if I leave thecontact_number
field empty.What I want is
If I further explain I want to validate mobile number only if the your provide a number. Otherwise my custom validatetor
mobile_number_validator
should not involve in the validation process. Is this possible to achieve?