yogsototh
yogsototh

Reputation: 15051

How to create text fields dynamically

Say I have a record like this:

type Library = { books : [Book] }
type Book = { title : String, year : Int }

And I want to dynamically create a UI to fill the Library record. I would want a button "Add" which would create two text fields per book.

And editing inside any text field would immediately be synced in the record structure.

How could I achieve this with elm 0.12?

Upvotes: 2

Views: 183

Answers (1)

thSoft
thSoft

Reputation: 22650

Learn about interactive UI elements and understand the TODO list example, which is pretty much isomorphic with what you want to acquire.

Upvotes: 2

Related Questions