Aşağıda html ve jquery kodlarım var, bir sonraki sayfada devam etmektense aynı sayfada gönder düğmesine basmak istiyorum. Ama bana hiçbir sonuç getirmiyor ve bir sonraki sayfaya gitmiyor. HTML kodunujquery web'i kullanarak aynı sayfadaki başka bir html'den görüntülenen gösterimi
<form id="create" action="/engine_search/search/" method="get">
<input style="height:40px;" type="text" class="form-control" placeholder="Search" name="q">
<center>
<input style="float:left; margin-left:150px;" type="submit" class="btn btn-default" value="Search">
</center>
</form>
jquery kodu:
<script>
$(document).ready(function() {
$('#create').submit(function() { // catch the form's submit event
$.ajax({ // create an AJAX call...
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..
$('#created').html(response); // update the DIV
}
});
return false; // cancel original event to prevent form submitting
});
});
</script>