5
How to do when you have N forms with same ID
, or CLASS
send the data (Submit) process and when finished processing change the color of the <'tr bgcolor="#FFFF00"'>
for green '#00FF00'
signaling that the process has been completed.
obs. All this has to happen without giving refresh (without updating) on the page and using php.
<table width="900" border="0" cellspacing="0" cellpadding="0">
<tr bgcolor="#FFFF00">
<td>
<form id="NOME-PADRÃO">
<fieldset>
nome:
<input type="text" id="nome" placeholder="Nome" />
e-mail
<input type="text" id="email" placeholder="Email" />
<input type="submit" id="enviar" placeholder="Enviar" />
</fieldset>
</form>
</td>
</tr>
<tr bgcolor="#FFFF00">
<td>
<form id="NOME-PADRÃO">
<fieldset>
nome:
<input type="text" id="nome" placeholder="Nome" />
e-mail
<input type="text" id="email" placeholder="Email" />
<input type="submit" id="enviar" placeholder="Enviar" />
</fieldset>
</form>
</td>
</tr>
<tr bgcolor="#FFFF00">
<td>
<form id="NOME-PADRÃO">
<fieldset>
nome:
<input type="text" id="nome" placeholder="Nome" />
e-mail
<input type="text" id="email" placeholder="Email" />
<input type="submit" id="enviar" placeholder="Enviar" />
</fieldset>
</form>
</td>
</tr>
You can’t have different elements with the same
id
! Useclass
for that reason.– user7261
Isn’t it MUCH more elegant for you to have the data listing and then a single form (or vice versa), with a single set of fields to be filled and submitted with AJAX and, if successful, the values of the fields would be cleared and the TR would change color? This way your application works with and without AJAX, without obstruction. ;)
– Bruno Augusto