ciao a tutti o un form che richiama una funzione del tipo
Codice PHP:
<form action="pagina.php" method="post" name="chiamata" onsubmit="return check();">
e la funzione check() che effettua diversi controlli ed una chiamata ajax tramite jquery
Codice PHP:
function check(){
if(document.getElementById('idHStart').options[document.getElementById('idHStart').selectedIndex].value >= document.getElementById('idHEnd').options[document.getElementById('idHEnd').selectedIndex].value && document.getElementById('idMStart').options[document.getElementById('idMStart').selectedIndex].value >= document.getElementById('idMEnd').options[document.getElementById('idMEnd').selectedIndex].value){
document.getElementById('notOraFine').innerHTML = "Non può essere inferiore o uguale all'orario di inizio";
return false;
}
.
.
.
.
// QUI EFFETTUO LA CHIAMATA
$.post("../modules/agendaUtil.php", { type:'checkData', data: year+month+day },
function(data){
if(data==1){
return false;
}
else{
return true;
}
});
}
il problema è che non mi effettua il return della funzione di callback?
Come mai? un problema di scope o altro?
grazie a tutti!