I am trying to get a list of names to be filtered as I type in.
The main page is as follows.
The MyAjax.js contains the following:
When there is no information in the text field, then I see the list of name, however it does not get filtered as I am typing.
Using firebug in Firefox, I think the issue is that the variable in the text field is not being sent across. Can anyone spot anything obviously wrong.
The main page is as follows.
Code:
<html>
<head>
<title>ajax test</title>
<script src="js/prototype.js" type="text/javascript"></script>
<script src="js/myAjax.js" type="text/javascript"></script>
</head>
<body>
<div id="namelist" name="namelist" style="height:350px;width:200px;"></div>
<div>
Name: <input type="text" id="fltName" name="fltName" size="25" />
</div>
<script>
Event.observe(window, 'load', function() {
Event.observe('fltName', 'keyup', function(e){filterByName(e);});
filterByName('');//this initially populates the select list with ALL names...
});
</script>
</body>
</html>
The MyAjax.js contains the following:
Code:
function filterByName(strname){
var params = new Hash();
params.set('namestring',strname);
params.set('actionval','getSelect');
new Ajax.Updater('namelist','adminAjax.php',{parameters:params,method:'get'});
}
When there is no information in the text field, then I see the list of name, however it does not get filtered as I am typing.
Using firebug in Firefox, I think the issue is that the variable in the text field is not being sent across. Can anyone spot anything obviously wrong.