3
I have a website that records building launches. Then some buildings have more than one tower, and I would like for each tower, I had the possibility to insert 4 inputs (type, footage, dormitories, vacancies)
Something more or less like this:
<form>
<input type="text" name="torres"><button id="addtorre">Adicionar Torre</button>
<button type="submit">Cadastrar</button>
</form>
Then put 2 in the field "towers" and click on "Adicionar Torre", would be:
<form>
<input type="text" name="torres"><button id="addtorre">Adicionar Torre</button>
<input type="text" name="tipo1">
<input type="text" name="metragem1">
<input type="text" name="dorm1">
<input type="text" name="vaga1">
<input type="text" name="tipo2">
<input type="text" name="metragem2">
<input type="text" name="dorm2">
<input type="text" name="vaga2">
<button type="submit">Cadastrar</button>
</form>
cool, almost there.. rs, the only thing is that the names got: type[]. And I wanted the qty to be related to the input "towers". it takes the number of towers and create an input group for each, you know?
– Leandro Marzullo
but that there is an array, each tower represents a key
– Wees Smith
sorry, I don’t understand, I’m still beginner
– Leandro Marzullo
Aah yes, right, let me put a reference then of what I did
– Wees Smith
takes a doubt, the turret 1 will already exist or is optional tbm?
– Wees Smith
ah vdd, the 1 already exists, then qd has more than 1 tower will add more
– Leandro Marzullo
I edited the reply, anything just warn
– Wees Smith
It worked, thanks!!
– Leandro Marzullo