i am new to jquery, i am working on a web page which needs generating text boxes dynamically with autocomplete facility.
i tested $("#some").autocomplete(data);
on some static content, it worked perfectly.
however, when i try the same technique with dynamically generated text boxes it's not working!
my code looks as follows:
$(function() {
$("#button_newproduct").click(function(){
$("#products_table > tbody").append(
"<tr><td><input type='text'name='td_products["+counter+"]'/></td></tr>");
});
var data = "Core celectors cttributes craversing canipulation CSS cvents cffects cjax ctilities".split(" ");
$('input[name^=td_products]').autocomplete(data);
});
thanks guys i am done with this with ur help.
now, another problem. i am loading the array(input to autocomplete) with a DWR call.as below
DwrService.populateProducts(someFunc);
function someFunc(result){
autoProducts=result;
input.autocomplete(result);
}
here problem is everytime making a DWR call to DB to get the array!
is there any way to store the array from DWR in a global variable?
regards
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…