Código:
Código HTML:<?php $cant = trim($_POST['txt_cant']); $id_cert = trim($_POST['txt_idcert']); for ($i = 1; $i <= $cant; $i++) { ?> <tr> <td> <table align="center" border="0" class="tablaformula2"> <tr> <?php if (pg_num_rows($resultfirma) > 0) { ?> <td width="112" align="right" nowrap><select name="selec_firma<?php echo $i ?>" id="selec_firma<?php echo $i ?>" onchange="firmante<?php echo $i ?>.value =this.options[this.selectedIndex].getAttribute('cedula_firma<?php echo $i ?>');nombre_firma<?php echo $i ?>.value = this.options[this.selectedIndex].getAttribute('nombre_firma<?php echo $i ?>');apellido_firma<?php echo $i ?>.value = this.options[this.selectedIndex].getAttribute('apellido_firma<?php echo $i ?>');"><option value<?php echo $i ?>="" cedula_firma<?php echo $i ?>="" nombre_firma<?php echo $i ?>="" apellido_firma<?php echo $i ?>="">Firmantes<?php echo $i ?></option> <?php while ($row4 = pg_fetch_assoc($resultfirma)) { ?> <option value<?php echo $i ?>="<?php echo $row4['cedula_persona'] ?>" cedula_firma<?php echo $i ?>="<?php echo $row4['cedula_persona'] ?>" nombre_firma<?php echo $i ?>="<?php echo $row4['nombre_persona'] ?>" apellido_firma<?php echo $i ?>="<?php echo $row4['apellido_persona'] ?>"><?php echo $row4['cedula_persona'] ?></option> <?php } ?> </select></td> <td width="190" align="left" nowrap><input name="firmante<?php echo $i ?>" type="text" id="firmante<?php echo $i ?>" value="" readonly></td> <td width="15%" height="31" align="center"> <input name="nombre_firma<?php echo $i ?>" type="text" id="nombre_firma<?php echo $i ?>" value="" readonly></td> <td width="15%" height="31" align="center"> <input name="apellido_firma<?php echo $i ?>" type="text" id="apellido_firma<?php echo $i ?>" value="" readonly></td> <?php } ?> </tr> </table> </td> </tr> <?php } ?>