Never mind I figured it out.

What I needed to was add the autocomplete after I put the row onto the
table. Doh!

// put the row into the table
$('#' + tableID).append(clonedRow);
$('#IngredientList'+newIndex+'Ingredient').autocomplete(data);

Which makes perfect sense now that I look at it.


Thanks



 

-----Original Message-----
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of Mauricio (Maujor) Samy Silva
Sent: Wednesday, January 14, 2009 5:20 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Noob


Use the new event feature .live(type, fn) [1] provided with the just
launched  realease: jQuery 1.3 [2]

[1] -  http://docs.jquery.com/Events/live
[2] - http://docs.jquery.com/Release:jQuery_1.3

MaurĂ­cio
-------------------------------------

> Hello,
> I have a table that has some form inputs in a single row. One of the 
> text inputs is an autocomplete that gets its data from a PHP variable.
> I have all that working.
>
> I have a button that clones this row and all its inputs incrementing 
> the IDs and then appending it to the table. That works fine.
>
> The problem I am having is that I dont know how to attach the 
> autocomplete to the input in the new row.
>
> I have pasted my code below. If you read it you can probably tell that 
> I ran into the same issue with the delete row button, but I got around 
> by using straight Javascript. But if I can solve how to attach to a 
> new element I can fix both problems.
>
>
> Thanks in advance.
> Steve

Reply via email to