samedi 18 avril 2015

event.preventdefault() removes question mark from url

I have a get form that loads a php file into a div. However the required event.preventdefault() removes the question mark and the form parameters from the url. How can I prevent this?



$(document).ready(function(){
$('#df').submit(function(){
var month_ddchart = $('#dm').val();
var year_ddchart = $('#dy').val();
source_ddchart = '/data/ddc-'+month_ddchart+'-'+year_ddchart+'-body.php';
$('#content_box').load(source_ddchart);
event.preventDefault();
});
});

Aucun commentaire:

Enregistrer un commentaire