HTML CODE
<a href="#" id="dob" data-type="date" data-value="2012-11-11" data-pk="1" data-title="Select date"></a>
PHP CODE (update.php)
<?php
//update.php
$connect = mysqli_connect("localhost", "root", "", "X-editable");
$query = "
UPDATE employee SET ".$_POST["name"]." = '".$_POST["value"]."'
WHERE id = '".$_POST["pk"]."'";
mysqli_query($connect, $query);
?>
JAVASCRIPT CODE
$('#dob').editable({
format: 'yyyy-mm-dd',
viewformat: 'dd/mm/yyyy',
url: '/post', defaultValue: "11/11/2012"
})
$('#dob').editable({
format: 'yyyy-mm-dd',
viewformat: 'dd/mm/yyyy',
url: '/post', defaultValue: "11/11/2012"
})