Are you talking about what the user is actively typing? Or the data ‘you’ sent to the form?
Either, but I am specifically trying to add and remove nested forms for a has_many
schema. Full details on this post: Poking and peeking form data
Never mind, it was there all along in @changeset
. I was thrown by IO.inspect
not printing the nested structs recursively.
After playing around some more, I now want to get the data the user has entered to the form. Is this possible?
Yep the drab page shows how to get information from the DOM, it’s very doable.
Not quite. That example is setting an assign instead of directly manipulating the DOM. It looks like Drab.Element
has what I am after.
The Simple example is getting the full contents of the form sent back to the server. Element tends to involve another round-trip, which adds a bit of latency, but if it’s fine for some use cases. You can then set DOM values directly using Element of course, but you asked how to get the data from the DOM.
Oh, I completely misunderstood that example, then. I’ll go over it again now. Thanks!