0
I need to get the value of inputs with ID nome and sobrenome, but when I use $_POST, it will return only the first, and I need all separately.
<form method="POST">
<tr id = "0">
<td>
<input id="nome"/>
</td>
<td>
<input id="sobrenome"/>
</td>
</tr>
<tr id = "1">
<td>
<input id="nome"/>
</td>
<td>
<input id="sobrenome"/>
</td>
</tr>
<tr id = "2">
<td>
<input id="nome"/>
</td>
<td>
<input id="sobrenome"/>
</td>
</tr>
<input type="submit">
</form>
What do you mean by "catch"? Do you mean the value entered in the fields? If so, use the global
$_POSTof PHP.– Woss
@Andersoncarloswoss Updated question.
– Lucas Caresia
Okay. First, the attribute
iddefine unique elements on the page, then create multiple elements with sameidmakes no sense. Second, define the attributesnameof the fields and add[]at the end. For example:<input name="nome[]" />", in this way$_POST['name']will be the list with all names filled in. That’s what you need?– Woss
Could you put that as an answer please ?? solved my problem.
– Lucas Caresia
Possible duplicate of Insert input value into array
– novic