Open madsem opened 2 years ago
Sorry… somehow I missed this until now!
I would expect either of the following to work:
x-wizard:step.rules="{ 'formData.zip': 'required|numeric|min:10|max:120' }"
(add quotes)
x-wizard:step.rules="{ formData: { zip: 'required|numeric|min:10|max:120' } }"
(nested)
What errors do you get with those two options?
@inxilpro how do I trigger the validation check?
I'm having an error as well when trying to use the validation Attached is the screenshot of my console
Hey there,
first off, this is an amazing package, thanks a lot for this. :)
Now, I am unsure if this is an AlpineJs issue, or if I'm just using it wrong, or if this has something to do with the wizard itself. But I thought I'd ask here.
I have a form with
x-init
like so:I initialize the
leadForm()
usingalpine.data()
in a js file, like so:./modules/alpine/form-data/index
In my form, I'd like to write a custom
Validatorjs
rule that will make an API call to check if the entered zip code is valid, but I am unable to reference theformData
zip code property in the validator directive, like so:results in
SyntaxError: Unexpected token '.'. Expected a ':' following the property name 'formData'.
Also wrapping the property name in quotes/double quotes does not work.