I'm new to ajax and having a bit of trouble with the 'onkeypress' event.
Here's the scenario...
User enters a search value into a text box, then clicks on an image to submit the request.
<img src="images/btnTownSearch.jpg" alt="Submit Search" style="margin-top:4px;" onclick="runSearch()" />
if (document.frmSearch1.txtCP.value != "")
http = createRequestObject();
http.open('get', 'maptools/searchLocation.asp?search=' + document.frmSearch1.txtCP.value );
http.onreadystatechange = handleSearchResponse;
alert("Please choose a centre point")
This works perfectly if you click on the image but I somehow need to modify the code to allow the request to be made when the user hits the 'enter' key.
Also, if it helps at all then here's a link to my page.
Any help would be appreciated,
Thanks in advance!