Hi,
I am new in jquery and I have code for autocomplete, but now I encountered error : ‘1’ is null or not an object when I type letter that was not available in the database. I want to disappear that error. But I don’t have any idea how can I disappear that error when I type letter which is not available or did not match in the database. But if I type letter that match in the database no error display.
here is my code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type='text/javascript' src='jquery.autocomplete.js'></script>
<link rel="stylesheet" type="text/css" href="jquery.autocomplete.css" />
<script type="text/javascript">
//----auto complete process name---//
$().ready(function() {
$("#process_name").autocomplete("get_process_list.php", {
width: 205,
matchContains: true,
mustMatch: true,
selectFirst: false
});
$("#process_name").result(function(event, data, formatted) {
$("#process_id").val(data[1]);
});
});
</script>
</head>
<body>
<form>
<table>
<tr>
<td>Process:</td>
<td><input type="text" name="process_name" id="process_name" value="" size="30"></td>
</tr>
</table>
<input type="hidden" name="process_id" id="process_id" value="" />
</form>
</body>
</html>
Any help is highly appreciated.
Thank you