| It's really not that simple. What about complex validation rules? Do you really think it's user friendly to require them to send the whole form just to tell them "sorry no" 10 times over until they get it right? What about multi-value selects, potentially with rules? E.g. form field like "choose up to 5 locations in the radius of 10km". What about form fields like "pick a point on a map"? Etc. Don't act like every form is 5 simple text inputs. |
You'll have to do in the server, if you're sane.
I bet Retool Forms does in the server.
You're worried the page will refresh with an empty form, if it fails. It's simple, just collect the data and return the form pre-filled using the value attribute, along with the error message.
If you don't want to refresh the page, you could even use something like htmx, which is a LOT simpler than React, but really not necessary for simple form submission.