Please take a look at the following code…
$("#page_info_select_box").live("keypress",function(){
var sele = "domain";
var inp = $("#page_info_select_box").val();
if(inp != null)
{ var start = "";
var i ;
$.get("admin/get_users_page",{qry:inp,selector:sele},function(data){
//alert(data);
for (i=0;i<data.length;i++)
{
start = start + "<option>" +data[i].tp1+"</option>";
}
$("#select_page_domain").html(start);
},"json");
}
});
The keypress event is working but its does not sending the correct text in the textbox.
whats wrong with me ?
if i type “ST” it only sending S not T
if i type SFY it seding SF not Y .
page_info_select_box is added dynamically.
Try
keyupinstead ofkeypress.http://jsfiddle.net/PfnT9/1/ (check it with firebug or chrome console)