Im trying to get the date from a date picker i have on my page and then have that date posted to a php function which will store the selected date in my database.
This is the code i am working with now but i am having no luck storing the date in a variable and then passing it into the
//php script where i want the date to become available
if(empty($_POST)===false){
$data = array(
'employee' => $user_data ['first_name'],
'store' => $user_data ['store'],
'noofdays' => $_POST['quantity']
);
//book_holiday($data);
header('Location: index.php');
exit();
}
//script
<script>
var date;
date= $('#datepicker').datepicker({
format: 'mm-dd-yyyy'
});
</script>
Is there any way i can do this as the way i am trying now will not save the date anywhere.
EDIT:
<form action = "" method = "post">
<div id="datepicker" style = "position:relative; TOP:15px;"></div><br><br>
<input type="submit"><br><br></form>
Aucun commentaire:
Enregistrer un commentaire