input type text and autocomplete - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: input type text and autocomplete (/showthread.php?tid=60725) |
input type text and autocomplete - El Forum - 06-14-2014 [eluser]mohssenvox[/eluser] hi , i am trying to autocomplete textbox , here is my code: view: Code: [removed] Code: public function search() { any idea..? input type text and autocomplete - El Forum - 06-14-2014 [eluser]CroNiX[/eluser] When you Code: $('.txtObjectName').autocomplete({ Also, element IDs are supposed to be unique. No 2 elements on the page should have the same ID. input type text and autocomplete - El Forum - 06-14-2014 [eluser]mohssenvox[/eluser] tnx for reply.... but how can i tell it in addRow function? input type text and autocomplete - El Forum - 06-14-2014 [eluser]CroNiX[/eluser] The same way you are when the page loads. Code: $(selector).autocomplete({options}); input type text and autocomplete - El Forum - 06-14-2014 [eluser]mohssenvox[/eluser] hmmm.., it mean i use like this...? Code: function addRow(frm) { input type text and autocomplete - El Forum - 06-14-2014 [eluser]CroNiX[/eluser] Essentially, but I would use it on the elements ID, which I mentioned needs to be unique, instead of the class. Otherwise it will reassign the autocomplete to the other elements that already have it assigned using that classname. You are creating this element with the same ID each time addRow() is called, so you need to fix that so it's unique, and then assign the autocomplete to that unique ID. Code: <input type="text" value="" name="txtObjectName[]" id="txtObjectName" class="txtObjectName" > input type text and autocomplete - El Forum - 06-15-2014 [eluser]mohssenvox[/eluser] i do it , i make my new input , with unique ID , still same problem.... input type text and autocomplete - El Forum - 06-15-2014 [eluser]CroNiX[/eluser] post your new code input type text and autocomplete - El Forum - 06-15-2014 [eluser]mohssenvox[/eluser] hmm , 1 one more thing , u dont know how many textbox , user created with script , if i make unique id for each input , it make something bad for my code like: Code: <input id="cm1" /> |