A
A
Andrei1penguin12020-11-25 00:58:29
Django
Andrei1penguin1, 2020-11-25 00:58:29

How to add multiple default values ​​to a tag?

Good day, the site displays photos in a certain place, the number of which can be changed in one direction or another, this is done like this:

{% for image in objects.image %}
    <img src="{{ image.url }}">
{% endfor %}
<button>

Accordingly, the task after deleting or adding records is to send them all to the server via django (yes, at least where, the main thing here is how it will come out of html), respectively, you need something similar to input multiple, but how to add all the photos to one input I don’t I know (it's possible to parse all the photos in the block with js and somehow add them to the input)
The problem is not even a lot of inputs, you can assign individual names to all, but even so I don't quite understand how to do this.
You need a default value, Will the idea work to parse the original photos in the block, use js to put their addresses into the value attribute of the input tag (with the multiple parameter), and then, as new ones are removed or added, also add them using js to the same value attribute?
Or is there a better solution?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question