You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by BennaceurHichem July 3, 2021
I'm implementing a phoneInput that contain two parts, the first is the flag of the country, with the countryCode and dialCode, the second is the phone input, I want to create a custom validation that validates the phone number using an external library which libphonenumber-js.
Th problem is that in the params passed into :validation-rules is the value only as I see in the doc : https://vueformulate.com/guide/validation/#custom-validation-rules
How can I pass the countryCode which is a data property in the custol input, to the params of the :validation-rules prop, to use it for validation with libphonenumber-js like this :
:validation-rules="{
phoneValidation: ({ value,//here I shoul get the countryCode }) => {
const pn = parsePhoneNumberFromString(value, //passcountryCode here for custom validation);
return pn?.isValid() ? true : false;
},
}"
```</div>
The text was updated successfully, but these errors were encountered:
Discussed in https://github.com/wearebraid/vue-formulate/discussions/458
Originally posted by BennaceurHichem July 3, 2021
I'm implementing a phoneInput that contain two parts, the first is the flag of the country, with the countryCode and dialCode, the second is the phone input, I want to create a custom validation that validates the phone number using an external library which libphonenumber-js.
Th problem is that in the params passed into :validation-rules is the value only as I see in the doc : https://vueformulate.com/guide/validation/#custom-validation-rules
How can I pass the countryCode which is a data property in the custol input, to the params of the :validation-rules prop, to use it for validation with libphonenumber-js like this :
The text was updated successfully, but these errors were encountered: