anon9372508
Generating clientside validation on inputs from ecto schemas/changesets
I’m looking for feedback on my idea of how I can possibly build a solution to creating client side dom validations using a changeset.
Before you say x framework, let me just stop you right here.
The primary focus of this convo I would like to keep to that of just conceptual ideas around the following:
- Create ecto schemas validations like we already do.
- Generate some data that describes these validations and package that along side or in a changeset
- Update the core components input functions to make use of this validation data and generate client side input validations like (required, minlength, pattern ect)
First has anything like this already been tried, done?
Second outside of the fanboyism for liveview/ash/hologaram/vue/svelte/x/y/z whats your take?
Personally I’m kind of shocked to not already see something that sets the required of an input by default even if just as a common pattern.
Most Liked
LostKobrakai
Ecto already does that: Ecto.Changeset — Ecto v3.13.4
Those attributes have footguns as well. E.g. if you have a required attribute on an input hidden by some UI like tabs or disclosure the form simply won’t submit without any feedback to the users what’s wrong.







