Replies: 2 comments 2 replies
-
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.
-
I have a quick test case here but I'm not happy with the way in which I have to do the Zod 'conditional' rules - but I'll drop it into ASP.NET Core Jint and see what happens? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
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