DEV Community

Discussion on: Awesome Forms with Solidjs

 
johncarroll profile image
John Carroll • Edited

Instead of looking at the real world example, take a look at the "Form Validation" example on the Solidjs webpage: solidjs.com/examples/forms. It makes use of the (probably less well known but very cool) directive's feature of solid. By extracting the HTML validation logic into a directive, it can be easily reused. Sounds like something along these lines might be exactly what you're looking for.

For my part, a big advantage of using a library like solid-forms is that it is not reliant upon the DOM and can be used both on the server and outside of solid equally well (e.g. I'm using this library in production in a react application via react-solid-state).

Thread Thread
 
xerullian profile image
Patrick Nolen

The directives in the Solidjs forms example are awesome! That example basically uses regular HTML. So simple.

Sure, you can't do that on the server, but I don't think forms should be handled on the server until they are submitted.