I have this jQuery code:
$(document).ready(function() {
$.ajax({
url: "pages/"+page+".php",
cache: false
}).done(function( html ) {
$('#main').html(html).css({"max-height":mH-30,"height":mH-30}).jScrollPane();
$('form').not('#loginf').submit(function(event) {
event.preventDefault();
var inputs = $(this).serialize();
$.ajax({
url: "pages/"+page+".php?"+inputs+'&action='+param,
cache: false
}).done(function( html ) {
update(html);
rs();
}).fail(function (){
window.location = "/CMS/";
});
});
});
So the submit function on the forms doesn’t work..
What’s intresting is that I also have another ajax on the page when some li element get clicked and on the done function there I also have the form submit function and it works there.
Is there something wrong with this code?
Never mind, i solved it by looking into this question answers:
problems with ajax request in page with form. jquery
The problam was as they said there with the
function(event)so I changed it tofunction(e)wierd why the first one didn’t work.