[jQuery] Re: Clone form fieldset, issues replacing id

2008-10-09 Thread Martin Sarsini
Wow cool! I will try to integrate it now, sounds great by the way, LodgeIt! it's fantastic On Oct 9, 2:42 pm, MorningZ <[EMAIL PROTECTED]> wrote: > It ain't pretty, but it works  :-) > > http://paste.pocoo.org/show/87509/ > > On Oct 9, 8:46 am, Martin Sarsini <[EMAIL PROTECTED]> wrote: > > > Unfo

[jQuery] Re: Clone form fieldset, issues replacing id

2008-10-09 Thread Vic
It was example Now : nel - number of "workfieldset", =1 when page loaded You need create construction like this: nel++; $(fromClone).find("input").each(function() { var s = $(this).attr("name"); s.replace(/([^\[]+)\[0\]/, "$1["+nel+"]"); $(this).attr("name", s); }); And for "label": $(f

[jQuery] Re: Clone form fieldset, issues replacing id

2008-10-09 Thread MorningZ
It ain't pretty, but it works :-) http://paste.pocoo.org/show/87509/ On Oct 9, 8:46 am, Martin Sarsini <[EMAIL PROTECTED]> wrote: > Unfortunately it is not that simple. > With your code it simply replaces the id of the fieldset, when I need > that it will go and replace the id of each id an

[jQuery] Re: Clone form fieldset, issues replacing id

2008-10-09 Thread Martin Sarsini
Unfortunately it is not that simple. With your code it simply replaces the id of the fieldset, when I need that it will go and replace the id of each id and name element of each form here is part of my code Place of work

[jQuery] Re: Clone form fieldset, issues replacing id

2008-10-09 Thread Vic
What about this: $(fromClone).attr("id", newId); or $(fromClone).attr("name", newName);