I would like to know how to get the input values of a form. I show the current values extracted from the database by means of an echo and the intention is to be able to change them.
The code (editproyectos.php) would be:
<table class='table table-bordered'>
<input type='hidden' name='id' value='<?php echo $row['id']; ?>' />
<tr>
<td>Titulo</td>
<td><input type='text' id="titulo" name='titulo' class='form-control'
value='<?php echo $tit_proyecto ?>' ></td>
</tr>
<tr>
<td>Fecha</td>
<td><input type='text' name='fecha' class='form-control' value='<?php echo $fech_proyecto; ?>' ></td>
</tr>
<tr>
<td>Texto 1</td>
<td><textarea class="form-control" name='text1' rows="2"><?php echo $texto1_proyecto; ?></textarea></td>
</tr>
<tr>
<td>Texto 2</td>
<td><textarea class="form-control" name='text1' rows="4"><?php echo $texto2_proyecto; ?></textarea></td>
</tr>
<tr>
<td colspan="2">
<button type="submit" class="btn btn-primary" name="btn-update" id="btn-update">
<span class="glyphicon glyphicon-plus"></span> Guardar cambios
</button>
</td>
</tr>
</table>
When I click on submit, I'm referred to the file crud2.js (the one below) but I can not get anything sent to "edit_proyectos_update.php".
$.post("editar_proyectos_update.php", $(this).serialize())
.done(function(data){
$("#dis").fadeOut();
$("#dis").fadeIn('slow', function(){
$("#dis").html('<div class="alert alert-info">'+data+'</div>');
$("#emp-UpdateForm_Proyectos")[0].reset();
$("body").fadeOut('slow', function()
{
$("body").fadeOut('slow');
window.location.href="login-register/index.php";
});
});
});