Form with AJAX
The table code:
<table>
</tbody>
<tr>
<td>
<form method="post"
<p align="left"><input type="text" name="myPart"></p>
<input type="submit" value="Search" onclick="Doit($myPart)" />
</td>
<td>
<input type="image" src="image.jpg" alt="Part" onclick="Doit('HP')"/>
</td>
</tr>
</tbody>
</table>
The Javascript code is:
<script type="text/javascript">
var http = getHTTPObject();
function Doit(sId)
{
var url="getData.php?id="; // getData.php writes data back
http.open("GET", url+escape(sId), true);
http.onreadystatechange=handleHttpResponse;
http.send(null);
/*
for (i=0; i<10; i++)
document.write("Is it working?");
*/
}
function getHTTPObject()
{
........
}
function handleHttpResponse()
{
.......
}
</script>
Warren
-
brianoh -
Thanks
{{ DiscussionBoard.errors[1274290].message }} -