<html>
<head>
<script language="javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
<script language="javascript">
$(document).ready(function() {
$("input[name='Submit']).click(function() {
$.get( // we use GET method
"getResult.php", // the ajax php script returning the result(s)
{searchValue: $("input[name='searchbox']").val()}, // parameter to send, the search value
function(data) { // if the ajax call is a success
$("##results").html(data); // set innerHTML of the div
}
);
});
});
</script>
</head>
<body>
<form action="" method="post" name="search">
<input name="searchbox" type="text" /><input name="Submit" type="submit" value="Search" />
</form>
<div id="#results">{$some_var1}, {$somevar2}</div>
</body>
</html>
|