ciao a tutti
ho una modal fatta con bootstrap, e sopra c'è un form(id="formnewstory"). quando faccio il submit del form chiamo una funzione in jquery che dovrebbe chiamare un php per fare alcuni controlli sulle date. va tutto bene sino a $.ajax, poi va in errore. se tolgo il form dal modal e lo metto sulla pagina funziona tutto. la funzione è questa sotto. piu sotto c'è l'output della console. qualche idea?
grazie a tutti per l'aiuto
codice:
$("#formnewstory").submit(function() {
var name = $('#name').val();
var startdate = $('#startdate').val();
var enddate = $('#enddate').val();
$.ajax({
type: 'post',
url: '/ajax/checkstorydates',
data: 'name=' + name + '&startdate=' + startdate + '&enddate=' + enddate,
success: function(results) {
var arrres = JSON.parse(results);
alert(arrres);
return false;
},
error: function(xhr, testStatus, error) {
console.log(xhr);
console.log(testStatus);
console.log(error);
}
});
});
codice:
Object { readyState=0, status=0, statusText="error"}
error
(an empty string)