anon9372508

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

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.

Where Next?

Popular in Discussions Top

JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1140 51847 244
New
adamu
When starting a new project, do you have any go-to libraries you pull in out of habit/preference? For example, Ash, Credo, Mox, ExMachin...
New
ivanminutillo
Bonfire is an open source framework for building modular federated digital spaces. It’s built entirely with Elixir, including LiveView (a...
New
AstonJ
@Garrison’s comment in another thread reminded me of this post by Joe: With the big five exerting more control than ever, new (AI) play...
New
arcanemachine
Just wondering what the community currently thinks, prefers, and/or recommends for working with UI components. (e.g. daisyUI, MishkaChele...
New
James_E
I see that the current ExUnit source code has support for rich failure messages on a small whitelist of “recognized” assertion patterns, ...
New
AstonJ
A remark @Garrison made… ..has already inspired a thread for the technical side of reclaiming our internet, but there is of course anot...
New
karlosmid
The |> operator appears in many languages, mostly in the functional world. F# has essentially the exact same operator, as does OCaml. ...
New
isaacsanders
When I try to run my applications and I haven’t updated the dependencies, the output tells me to run mix deps.get. Why doesn’t the binar...
New
AstonJ
Inspired by Andrew’s post in another thread about types: If the main benefit of static typing is to catch errors, and most people think...
New

Other popular topics Top

senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 35421 110
New
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New

We're in Beta

About us Mission Statement