Re: [phoenix-core] Proposal: Rendering forms without ID collisions

48 views
Skip to first unread message

José Valim

unread,
Sep 30, 2020, 1:55:54 PM9/30/20
to phoeni...@googlegroups.com
Latest version of phoenix_ecto allows the ID to be given to the form and all IDs generated by the form will be prefixed by that ID. :)

On Wed, Sep 30, 2020 at 7:33 PM Nick Wessing <ni...@headway.io> wrote:
I am working in liveview and one thing I am noticing that is tripping up myself and other developers on my team, is that when duplicate IDs happen, things can go south pretty quickly. It doesn't help that the form_for helper auto generates IDs on all of its input elements. 

I propose a that form_for accepts an id_prefix option that will be used when generating all of its inputs. This way developers have an easy way to put multiple forms on a page without worrying about manually specifying an ID for every single input element.

--
You received this message because you are subscribed to the Google Groups "phoenix-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phoenix-core...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/phoenix-core/a0bc85c4-844d-4284-a81b-7bb285c1cfd1n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages