I am hoping someone can help me with this problem I am facing:
I have an ajax call as follow:
$(document).ready(function(){
$("#booking").submit(function() {
var arrival = $('#arrival').attr('value');
var departure = $('#departure').attr('value');
var ap_ID = $('#ap_ID').attr('value');
$.ajax({
type: "POST",
url: "ajax/val_booking.php",
data: "arrival="+ arrival +"&departure="+ departure +"&ap_ID=" + ap_ID,
});
return false;
});
});
All the fields in the html form have a "name" attribute.
When sending info the ap_ID is sent but the arrival and departure are empty (checked with Firebug).
Also used serialize() but same result.
Does anyone know where might be the problem or what I might be doing wrong?
Thank you everybody for your help.
PS: I am using datepicker
.val()instead of.attr()