Replies: 1 comment
-
I had an idea to use Zod to define the validation rules (https://zod.de) rather than the native FormKit validators and then on the backend (ASP.NET Core in my case), populate that schema with the POSTed data and re-use the same Zod rules using the JINT library (see https://github.com/sebastienros/jint). I had some success in a previous role executing the Javacript rules and calculations for a bespoke forms solutions using JINT (JINT isnt' a wrapper around a Javascript engine as such, so can be considered much lighter weight). I need my FormKit forms to be dynamically generated - so hence not being able to get to implementing the above yet though - sorry! |
Beta Was this translation helpful? Give feedback.
-
Hey folks,
Does anyone have a best tip / example on how you would also do inline per field validation when you wan to make sure the backend also agrees with the frontend ?
Is a generic backend validator a bad idea ? Or is something similar already built and I can't find it ? :D
Beta Was this translation helpful? Give feedback.
All reactions