Lourdes Villanueva
unread,Jan 20, 2013, 2:48:23 PM1/20/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to fanc...@googlegroups.com
hahaha sure!
Here is the part where I call the form to show inside the fancybox and send the POST data:
$("#jugadoresForm").submit(function() {
$.fancybox.showLoading(); // start fancybox loading animation
$.ajax({
data: $(this).serialize(), // get the form data
type: $(this).attr('method'), // GET or POST
url: $(this).attr('action'), // the file to call
success: function(response) { // on success..
$.fancybox({ 'content' : response }); // target response to fancybox
},
complete: function() { // on complete...
$.fancybox.hideLoading(); //stop fancybox loading animation
}
});
return false; // stop default submit event propagation
});
I receive all the parameters correctly so no issue here...
Now...in the fancybox with the form I have 3 buttons:
For example this one:
<input type="submit" id="btnModificarJugador" name="btnModificarJugador" value="Guardar" />
And I use an isset function to know which one was submitted:
if(isset($_POST['btnModificarJugador']))
{
$con = connectDB($host, $user, $password, $db);
$nomCompleto = "".$_POST['txtNombreJugador'];
$nomCorto = "".$_POST['txtSNombreJugador'];
$fecNac = "".$_POST['txtFechaDeNacimiento'];
$luNac = "".$_POST['txtLugarDeNacimiento'];
$nac = "".$_POST['drpdwnNacionalidad'];
$fecDebut = "".$_POST['txtFechaDeDebut'];
$parDebut = "".$_POST['txtPartidoDeDebut'];
$p = "".$_POST['txtPeso'];
$est = "".$_POST['txtEstatura'];
$equ = "".$_POST['drpdwnNombreEquipo'];
$pos = "".$_POST['drpdwnPosicion'];
$sta = "".$_POST['rdStatus'];
$tra = "".$_POST['txtTrayectoria'];
updatePlayer($playerID, $nomCompleto, $nomCorto, $fecNac, $luNac, $nac, $fecDebut, $parDebut, $p, $est, $equ, $pos, $sta, $tra);
closeConnection($con);
}
Well..that doesn't work..it doesn't update my player :(..and no..the function is well written so the updatePlayer function is not the issue.
Fancybox just closes and do nothing... what can I do? :(