Ok thanks
Another bit im stuck with now is passing data from a form input field to a named function within my php file.
This is all the code I have so far, but as Im new to it not sure if its the right way.
The script is:
Code:
$('#add-dates').bind('click', function() {
$.ajax({
url: 'checksess.php',
action: 'addhiredates',
type: 'post',
cache:false,
data: $('.datepicker input[type=\'text\']'),
success:function(data){
if (data == 'yes') {
add();
$('#date_data').hide();
}else{
$('#product_data').show();
$('#date_data').show();
}
}
});
});
My php code is:
PHP Code:
function addhiredates() {
if (isset($this->request->post['hiredate'])) {
$hiredate = 'yes'; }
echo 'yes';
}
And the html code is:
Code:
<div id="datepicker" class="datepicker">
<input type="text" id="acdate" name="hiredate" class="hasDatepicker">
<a id="add-dates" class="button-cart"></a>
</div>