You are almost there, except the mistake in
alert(tag);
it should be
alert(result);
for example, page1.html:
<html>
<head>
<script>
src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
</head>
<body>
<form name="frm1" id="frm1" method="post" enctype="multipart/form-data">
<label>SEARCH:</label>
<input name="tag" type="text" id="tag" size="20">
<input name="tag1" type="text" id="tag1" size="20">
</input></input></form>
<script>
$(document).ready(function() {
$("#tag").change(function() {
$.ajax({
type: "POST",
url: "autocomplete1.php",
data: {
tag: $("#tag").val()
},
success: function(result) {
alert(result);
}
});
});
});
</script>
</body>
</html>
To receive the data in autocomplete1.php:
<?php
$request = $_POST['tag'];
echo $_POST['tag'];
?>