-
-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to validate a specific field when input changes (Solid) #116
Comments
I think that the behavior you need can be controlled by the |
Using |
Currently, this is not planned. In most cases, validation is so fast that optimization is not necessarily required. Feel free to go into more detail about your use case so I understand why this feature might be useful. |
Let's say I have a form with two fields: name and password. While on the name the only verification that has to be done is to check if it's not empty, I may want to show the minimum requirements of the password while the user is typing and if they are fulfilled I then hide the requirements. Even without the per-field validation there are no problems but I guess it might be a bit annoying seeing the error message even though you have not finished typing everything. This is more than anything a QoL feature since like you said validation is fast enough that there would be no slowdowns. An example with email and password: firefox_2LTOaKOQrw.mp4I get the error in email as soon as I type which for some might be bothersome I guess. |
I understand. Technically, it should be possible to add this feature. However, I don't have the time at the moment. |
Feel free to do it whenever you think is the right time. I've recently started using Solid and this library helps a lot in managing forms, keep it up! |
I currently have a password field which is validated using
refine
fromzod
. But when the user first starts entering the password it is not validated and only on submit the validation starts. I knowvalidate()
exists but when I'm styling the input to show the errors I don't want the page to be loaded and the field already showing errors without the user even interacting with the field.So how could I force the validation to be run onInput?
relevant code:
The text was updated successfully, but these errors were encountered: