Código HTML:
<td><b>Registro de titulos:</b><input type='text' width='300px' name='titulo[]' placeholder='Titulo'></td>
<td><input type='text' name='titulo[]' placeholder='N° registro del titulo'></td>
<td><input type='Institucion' name='titulo[]' type='text' placeholder='Nombre de la institucion'></td>
<td><a href="agregartitulo">Añadir Otro</a></td>
</tr>
</br>
</br>
<tr>
<td><b>Cursos:</b><input type='text' width='300px' placeholder='Nombre del curso' name='curso[]'></td>
<td><input type='number' placeholder='Duracion Hr/s' name='curso[]'> </td>
<td><input type='Institucion' placeholder='Nombre de la institucion' type='text'name='curso[]'></td>
<td><a href="agregarcurso">Añadir Otro</a></td>
AQUI AGREGAMOS MAS CAMPOS EN EL FORMULARIO
Código:
$(function () {
$('a[href="agregartitulo"]').on('click', function (event) {
event.preventDefault();
$(this).before("</br><input type='text' name='titulo[]' placeholder='Nombre de titulo'><input type='number' name='titulo[]' placeholder='N° registro del titulo'><input type='text' name='titulo[]' placeholder='Nombre de la institucion'>");
$(this).removeAttr('a');
})
$('a[href="agregarcurso"]').on('click', function (event) {
event.preventDefault();
$(this).before("</br><input type='text' width='300px' name='curso[]' placeholder='Nombre del curso'><input type='number' name='curso[]' placeholder='Duracion Hr/s'> <input type='text' name='curso[]' placeholder='Nombre de la institucion'>");
})
})
]
deseo ingresar datos para registros en php en la misma tabla simultaneamente
Código PHP:
print("<pre>");
print_r($_POST);
/* $consulta="INSERT INTO `CLASIFICACION_DOCENTE`.`titulos` (
`cedula` ,
`nombre_titulo` ,
`nombre_universidad` ,
`nro_registro`
)
VALUES (
'$cedula', '$reg', '$reg', '$reg'
);";
mysql_query($consulta,$conexion);
*/
print("</pre>");
?>
EL PR