How to pass 2 variables to a php document with jquery
- by Nikos
Hello I have two text inputs which get their values from a datepicker.
What I want to do is when user selects the two dates script pass these two values to a php document in which I make some checks and I return some html.
Here is what I'm trying to do:
(#to and $from are 2 input texts)
$(document).ready(dateinput_change);
function dateinput_change(){
$('#to').change(check_availability);
$('#from').change(check_availability);
}
function check_availability(){
var to=$('#to').attr('value');
var from=$('#from').attr('value');
$.get("get_availability.php?to="+ to +"&from="+ from, show_availability);
}
function show_availability(available){
$('#availability').html(available);
}