Answer the question
In order to leave comments, you need to log in
How to display several identical fields in a form (Drupal 8)?
Hello. Please help.
There is a utility user XML document that contains data about the meters
of this subscriber. It is necessary to programmatically create a form in which there will be:
the ability to enter new readings.
A subscriber can have several such counters (one subscriber - one XML document).
As a result, it should be that, while parsing this XML document, I start a loop that, finding the counter, takes its ID and forms a form field of the "textfield" type for it. Accordingly, if there are several counters, then there will be several textfields.
Actually a question. How can I programmatically build such a form? After all, each of the received fields needs to be defined somehow (because then, when transferring to the server, it needs to know for which counter what value was entered).
Thank you in advance!
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question