MAIN.PHP
<html>
<form name="input">
<input type="date" id="userdate">
<input type="text" size="50" id="searchterm">
</form>
<div id="content"></div>
</html><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.css" />
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.5.3/jspdf.min.js">
</script>
<script>
$(document).ready(function () {
$('#searchterm').change(function() {
userdate = $("#userdate").val();
searchterm = $("#searchterm").val();
$.ajax({
type:'GET',
url: 'test2.php',
data: {userdate:userdate,searchterm :searchterm},
dataType: "json",
async: false,
success: function(data)
{
alert(data);
document.getElementById('#content').innerHTML += value;
$("#content").html(data);
//console.log(data);
}
});
});
});
</script>
TEST2.PHP
<?php
include('/include/config1.php');
$kdt = $_GET['userdate'];
$searchTerm = $_GET['searchterm'];
$select =mysql_query("SELECT man_id,man_name,join_date FROM manmaster where (man_id LIKE '%".$searchTerm."%' or man_name LIKE '%".$searchTerm."%')
and join_date<='$kdt' ") or die('Query not Executed..!..' .mysql_error());
while ($row=mysql_fetch_array($select))
{
$data[] = $row['join_date']."-".$row['man_id']."-".trim($row['man_name']);
//$data[] = $row['eff_date']."-".$row['token_id']."-".$row['man_id']."-".trim($row['man_name']);
//$data[] = $row['token_id']."-".$row['man_id']."-".trim($row['man_name'])."-(".$row['eff_date'].")";
}
echo json_encode($data);
?>
THE FOLLOWING AUTOSEARCH CODE WORKING FINE...but here i didnot know how to pass the date value then the employee id or Employee name value
<script>
//type="text/javascript">
$(function()
{
$( "#searchterm" ).autocomplete({
//source:"autosearchwithdate.php?effdate="+$('#effdate').val()+"&"+"empsearch="+$('#empsearch').val(),
source: 'autocomplete_salary.php'
//source: 'autosearchwithdate.php'
});
});
</script>