handle multi jquery autocomplete -


i have put several autocomplete input box in same page, like

<input id=ipa ... <input id=ipb ... <input id=ipc ...  $(ipa).autocomplete({...source:jsonp.php...data:{type:'aaa'}... $(ipb).autocomplete({...source:jsonp.php...data:{type:'bbb'}... $(ipc).autocomplete({...source:jsonp.php...data:{type:'ccc'}... 

is there way combine them 1 ?!

thanks,

actually if want 3 autocomplete input boxes, need 3 jquery object of autocomplete class. if want reduce duplicate code, can create function input element id , datasource (or other parametrs need), call 3 times , store each 1 different variable.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -