Closed albu77 closed 3 years ago
I'm assuming that you're talking about this REPL https://svelte.dev/repl/faf5a9ab763640ed830028c970421f72?version=3.35.0
1) I just tested out the minimal example and I get the expected behaviour Are you sure that you didn't mess something up? Are you using a special browser?
2) This is also the expected behaviour. minLength(5) means that the value must be at least 5 characters long if not it shows an error to the user
3) You can add a validator either in the form initialisation useForm({ minimalExample: { validators: [minLength(5), maxLength(5)] } }
or as an action <input name="minimalExample" use:validators={[minLength(5), maxLength(15)]} />
just make sure that you import maxLength from "svelte-use-form".
Ok, you are right, the problem was I was waiting for a message without getting out of focus from the input.... And for the maxLength, I didn't add the on="maxLength" on the Hint..... My Bad....
pas de problème 😄
I'm playing with the Repl on svelte site and I can't understand 3 things 1°) If I use the default code I don't have any error displayed for 5 minimal characters. 2°) If I remove the comments and have the
I got the error if entered less than 5 char 3°) I can't find a way of adding a second validator for example maxLength = 15