Hi;
I am implementing a Ajax auto suggestion search from database. I find an example from I have not problem with the php part about search from database, but i got a problem from the search from, i added a listerner to input tag, but it still not auto suggest anyword when i type any of word, Could any one help me, Thanks.
<html>
<head>
<title>roScripts - Ajax auto-suggest</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script src="lib/prototype.js" type="text/javascript"></script>
<script src="src/scriptaculous.js" type="text/javascript"></script>
<script src="src/unittest.js" type="text/javascript"></script>
<script src="lib/builder.js" type="text/javascript"></script>
<script src="src/controls.js" type="text/javascript"></script>
<script src="src/effects.js" type="text/javascript"></script>
<link rel="stylesheet" href="css/style.css" type="text/css" />
</head>
<body>
<div id="container">
<form method="post" action="response.php">
<label for="testinput">Search</label><br />
<input type="text" id="search" name="search" autocomplete="off" class="input" value="" onkeyup="autoSuggest();" /><br />
<div id="update" style="display:none;position:relative;"></div>
<input type="image" name="register" class="submit-btn" src=" alt="submit" title="submit" />
</form>
<script type="text/javascript" language="javascript" charset="utf-8">
function autoSuggest(){
new Ajax.Autocompleter('search','update','response.php', { tokens: ','} );
Autocompleter.show();
}
</script>
</div>
</body>
</html>
I am implementing a Ajax auto suggestion search from database. I find an example from I have not problem with the php part about search from database, but i got a problem from the search from, i added a listerner to input tag, but it still not auto suggest anyword when i type any of word, Could any one help me, Thanks.
<html>
<head>
<title>roScripts - Ajax auto-suggest</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script src="lib/prototype.js" type="text/javascript"></script>
<script src="src/scriptaculous.js" type="text/javascript"></script>
<script src="src/unittest.js" type="text/javascript"></script>
<script src="lib/builder.js" type="text/javascript"></script>
<script src="src/controls.js" type="text/javascript"></script>
<script src="src/effects.js" type="text/javascript"></script>
<link rel="stylesheet" href="css/style.css" type="text/css" />
</head>
<body>
<div id="container">
<form method="post" action="response.php">
<label for="testinput">Search</label><br />
<input type="text" id="search" name="search" autocomplete="off" class="input" value="" onkeyup="autoSuggest();" /><br />
<div id="update" style="display:none;position:relative;"></div>
<input type="image" name="register" class="submit-btn" src=" alt="submit" title="submit" />
</form>
<script type="text/javascript" language="javascript" charset="utf-8">
function autoSuggest(){
new Ajax.Autocompleter('search','update','response.php', { tokens: ','} );
Autocompleter.show();
}
</script>
</div>
</body>
</html>