Closed krajcikondra closed 5 years ago
Thanks for using my library! One simple solution is when the user checks the checkbox you just copy the text from billing address input to delivery address input so the validation will be passed.
For conditional validation, you can pass a function to validator
props of your delivery address input and return true
or false
based on your checkbox and delivery address state. I wrote an example for you here, and you can also find the example in my doc. @krajcikondra
Hi,
I have e-shop with 3 steps order form. There is a form with delivery address, billing address and checkbox (Delivery address is same as billing address) in 2 step. When user dont checked checkbox then delivery address is required. When user checked checkbox then delivery address is not required.
So I need to add conditions to inputs in delivery address for checkbox checked.
Is there some way to do it?