<input type="text" name="search" id="search_by" value="<?php if($_POST) echo $_POST['search']; ?>" onkeyup="return amazon_keyup_data()">

<div id="loader" style="display:none">
<img src="img_loader.gif" />
</div>

<div id="html_show"></div>

<script>

function amazon_keyup_data()
{

var searchfield_value = $("#search_by").val();
$("#loader").show();
$.ajax({
url: 'http://localhost/AmazonECS_133/Exeu-Amazon-ECS-PHP-Library-1867eaa/samples/searchurl.php',
data: 'searchfield_value='+searchfield_value,
type: "POST",
success: function(responsedata){ //alert(response);
$('#html_show').html(responsedata);
$("#loader").hide();

}
});
}

</script>

For posting multiple values:

data: { code: code, userid: userid }

Send complete form data:

var data = $('#formid').serialize();
Advertisements