Well, the clone will have the same ID (interestingly)... but only the
first (original) DIV will be selected if you use the id selector...
I suggest changing the ID of the clone right after you create it...
$("#div1").clone(true).attr("id", "div2").insertAfter("#div1");
thanx
will it give me different div id's?
so that i may find any child element on it's parent's div id.
like
$('#parent').child(0) to get 1st div child
and
$("#parent1").child(0) will give me cloned div's first child.
how can i differentiate between these divs?
thanx
On Jan 2, 12:43 am, Šime
$("#parentdiv").clone(true).insertAfter("#parentdiv");
Hello again !
I'm back on this project, and I tried the trick you gave me.
Unfortunately, that doesn't seem to work.
The newly created sortable doesn't accept elements... :-(
The only 'solution' I have for now is to create a bunch of hidden sortables
at the bottom of my source code, and move (appe
Ok., i have answer,
below code if someone need:
http://code.jquery.com/jquery-latest.js";>
$(document).ready(function(){
$("#pole_a").change(function () {
var text = $(this).val();
$("#pole_b").val(text);
});
});
On 10 Wrz, 20:16, PIT_777 wrote:
> Hi,
> i
That's a great idea.
I tried something similar but your way seems better :)
I'm currently on a trip, I'll keep you in touch.
Jérôme.
On Tue, Jul 28, 2009 at 15:07, Mean Mike wrote:
>
> I have an idea not sure if it will work or not but instead of trying
> to find a plug in to do the live() func
I have an idea not sure if it will work or not but instead of trying
to find a plug in to do the live() function with sortable why not just
target the newly created list you could make a function something
like this
function make_sortable(item){
$(item).sortable({
revert:
That's seems to be exactly what I needed.
Unfortunately, live() only works with a limited number of events, and not
with sortable.
I saw there may be a plugin that could help : livequery.
No time to investigate further for now.
See you in a few weeks !
:D
On Fri, Jul 24, 2009 at 18:27, Jérôme GRAS
No problem for the delay, thank you for your response.
I may be away for a while but I'll try to test and investigate as soon as
possible.
I will keep you updated.
On Fri, Jul 24, 2009 at 16:16, Mean Mike wrote:
>
> its because you need to make it live so that when new items with the
> same clas
its because you need to make it live so that when new items with the
same class show up they become sortable. I've never used live with
sortable so you might need to investigate further but I think this
will work
$(".liste_champs")live("sortable", function(){
revert: true,
connectWith
Ok, I fixed the first id bug.
The new version is online.
Unfortunately, the main problem is still present.
I tried a lot of things unsuccessfully...
Please take a look :-)
On Fri, Jul 17, 2009 at 15:07, Mean Mike wrote:
>
> I found a least one major problem here
>
> $("#champs").append($("#cha
I found a least one major problem here
$("#champs").append($("#champs_caches").clone(true).removeClass("ui-
helper-hidden"));
your cloning div with id "#champs_caches" thereby creating another
div with the same id
there may be more problems than that but get that fixed then lets go
from there
Thanks a lot for the help James. I'll give that a shot. I am re-
tooling this little application and I'm beginning to think I may not
need tables at all. I'll keep you posted.
Thanks again
On Jul 13, 8:24 pm, James wrote:
> I think there's some issues with fadeIn/fadeOut for .
> Try something
I think there's some issues with fadeIn/fadeOut for .
Try something like the following:
var html = 'hello';
$('#groups').append(html).find("td").fadeIn("fast");
The class "hide" on the is style with display:none;
Add this to all your if you have more than one.
On Jul 13, 2:05 pm, Nate wrote:
LOL - I swear I thought of almost the exact same thing when I went out
and took a drive...it's amazing what time away from the computer
does...and of course, a little help.
Now I seem to be missing something (yeah, I am new to jQuery...)
I still want that table row to fade in...but neither metho
How about just removing the empty and use something like the
following for your insert row after your AJAX response:
$("#groups").append('');
On Jul 13, 1:00 pm, Nate wrote:
> Also, James, each table row has a unique id. it will be called
> something like id="group34" or id="group35" - no
Also, James, each table row has a unique id. it will be called
something like id="group34" or id="group35" - no two are the same.
It's info that is related to the ID of the database.
So when my jQuery posts to addgroup.php, it inserts the data into the
database, and then I use the mysql_inser_id
Here is the PHP code that generates the entire table, plus the empty table
row.
I don't see anywhere in the code where you're setting an ID to the
. And if you're cloning an existing that has an ID, that may
cause issues because IDs are suppose to be unique on a page.
Is there any reason you're cloning an existing instead of
just appending it in with all the other content?
Thanks oly.yates,
your code is a good start.
I'll give it a try and post my results.
Soon.
On 14 Mag, 08:51, "oly.yates" wrote:
> Have you tried using the .attr() or .val() functions to modify the
> value of the cloned node?
> var node = $("some node").clone(true).val("some value");
> var node
Have you tried using the .attr() or .val() functions to modify the
value of the cloned node?
var node = $("some node").clone(true).val("some value");
var node = $("some node").clone(true).attr("some attr", "some value");
On 14 May, 00:13, rmfjcr wrote:
> Hi everybody.
> I've got a form where us
Wow. I would never have figured this out. The docs don't mention
serial appending like this. I was trying to do what you recommended
but with the javascript concatenator (+) instead of a comma (,).
Everything is working perfectly now. Thanks for your help.
On Mar 5, 1:07 pm, ricardobeat wrote:
You can append more than one thing at a time:
$('#clonehere').append($('.hook:first').clone(true), "Some text");
On Mar 5, 3:35 pm, bstoppel wrote:
> You're totally right. In my real code I am appending text as well as
> the cloned form.
You're totally right. In my real code I am appending text as well as
the cloned form.
>
> > > -Original Message-
> > > From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
>
> > > Behalf Of bstoppel
> > > Sent: Thursday, March 05, 2009 11:07 AM
> > > To: jQuery (English)
> > > Subject: [jQuery] Re:
> and clone the div...?
>
> > Rick
>
> > -Original Message-
> > From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
>
> > Behalf Of bstoppel
> > Sent: Thursday, March 05, 2009 11:07 AM
> > To: jQuery (English)
> > Subject: [jQ
rm...,
> and clone the div...?
>
> Rick
>
> -Original Message-
> From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
>
> Behalf Of bstoppel
> Sent: Thursday, March 05, 2009 11:07 AM
> To: jQuery (English)
> Subject: [jQuery] Re: .clone a form
&
Possible work-a-around...
Enclose your form in a div, say "form...,
and clone the div...?
Rick
-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of bstoppel
Sent: Thursday, March 05, 2009 11:07 AM
To: jQuery (English)
Subject: [jQuer
Without the .html() part you get an object. With .text() you get what
appears to be HTML entities and text.
On Mar 5, 6:10 am, "Rick Faircloth" wrote:
> Not sure, but it might be that the .html() part is telling
> the clone function to just clone the html *within* .hook:first.
>
> What happens
Not sure, but it might be that the .html() part is telling
the clone function to just clone the html *within* .hook:first.
What happens if you leave off the .html() part?
Rick
-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of bstoppel
S
Stephen,
$(id).replaceWith("invoice_lines_attributes_new_" + $(this).val()
+1 + "_description");
You should take arithmetic operations in paranthesis when concatenating
these with strings, or javascript will append these also as strings.
Cheers
Rasit
2009/2/25 Stephan Veigl
>
> Hi Stephen,
>
Hi Stephen,
could you post some HTML snippets as well?
What should $(this).val() be? Should the ID be dependent of the
textarea input or should it simply be the row number?
by(e)
Stephan
2009/2/25 stephen :
>
> Hello, I relatively new to Javascript in general, but I've been
> attempting to use
Maybe you want to use the clone() function to help you out:
http://docs.jquery.com/Clone
On Feb 16, 12:44 pm, "David .Wu" wrote:
> sometimes we have two form that almost the same fields, so we will
> give client a clone button if the information is complete the same,
> this is how I do now, is t
> > It varies depending on the browser.
> Which ones?
I was pretty sure that attachEvent was copied to a clone in IE,
although the rules you mentioned above would seem to indicate that it
shouldn't be. Cloning various form elements also varies, although
perhaps those are attribute-vs-property is
On Jan 28, 10:20 am, Dave Methvin wrote:
> There are the "static" properties and attributes that were defined in
> the HTML itself, and then the "dynamic" ones that reflect the current
> state of the element, including things like attached event handlers.
> Unfortunately, the W3C doesn't make i
There are the "static" properties and attributes that were defined in
the HTML itself, and then the "dynamic" ones that reflect the current
state of the element, including things like attached event handlers.
Unfortunately, the W3C doesn't make it totally clear what is supposed
to be copied on a c
Something along the lines of
$('#first').click(function(){
$(this).after( $(this).clone(true) );
});
?
On Jan 25, 10:43 am, sem101 wrote:
> This sentence totally freaks me out...
>
> "Create a button that's able to clone itself - and have the clones
> themselves be clonable."
On Wed, Dec 17, 2008 at 1:52 PM, Mike wrote:
>
> I am recieving an unsecure its on page error from an HTTPS page that
> looks fine with all hyperlinks. I narrowed it down to the jquery
> clone method, as it is cloning a hyperlink, but the href is https on
> their. Not sure why this would cause
On Nov 5, 2008, at 6:53 PM, Rafael Soares wrote:
I had a similar problem...
The difference is that I'm trying to clone the file input inside the
same
document, just another, hidden, form.
I found a workaround, but I don't know if it'll work for you as well.
Since I was going to clear the fo
I had a similar problem...
The difference is that I'm trying to clone the file input inside the same
document, just another, hidden, form.
I found a workaround, but I don't know if it'll work for you as well.
Since I was going to clear the form after the whole thing anyway, I decide
to do the inve
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
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
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
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
What about this:
$(fromClone).attr("id", newId);
or
$(fromClone).attr("name", newName);
Tried again, but changed the code so the new product will be prepended
to the fieldset#step1 -- so, it's always at the top of the page.
$("#add").click(function() {
$("div.product-template:first").clone(true).prependTo("#step1");
});
Events get copied but
Hi KArl,
I didn't know that. Will try again.
Elle
On May 3, 2:43 am, Karl Swedberg <[EMAIL PROTECTED]> wrote:
> Hi Elle,
>
> When the book was published, .clone() didn't have the event-cloning
> option. That was added in one of the 1.2.x releases. So if you're
> using a version of jQuery after
Hi Elle,
When the book was published, .clone() didn't have the event-cloning
option. That was added in one of the 1.2.x releases. So if you're
using a version of jQuery after 1.1.x, you should remove the
cloneEvents.js script and try with .clone(true)
--Karl
_
Karl Swedb
Hi Karl, and thank you for your reply.
This didn't really work -- unless I missed something important on the
way.
I was reading "Learning jQuery" and it says that .clone() doesn't copy
the events related to the cloned items (which I need). It suggested to
use copyEvents.js So, I have that script
Hi Elle,
Here are a few thoughts.
Your code:
$("#add").click(function() {
$(".product-template").clone().appendTo(".product-template:last-
child");
});
- Do you have this inside a document.ready?
$(document).ready(function() {
$("#add").click(function() {
$(".product-template").clo
Jim,
>I'm using the following code to get all selected checkboxes from my
>html page and copy them into the form I'm about to submit:
>
>$
>("[EMAIL
>PROTECTED]'BatchItem']:checked").clone().appendTo("#checkboxContainer")
>;
>
>I'm pretty certain that with previous versions of jquery (specifical
Why to the jQuery list? jquery-dev is typically where we discuss
issues of this matter.
--John
On Feb 6, 2008 8:47 PM, Eridius <[EMAIL PROTECTED]> wrote:
>
>
> i have this
>
> self.element.children('.cr_tab_content').append(self.element.children('#' +
> id).clone(true));
>
> and this does nothin
jQuery.clone(true) will only clone the events that it knows about ...
in other words ... it clones the events it bound.
--
Brandon Aaron
On Jan 29, 10:35 am, chrismarx <[EMAIL PROTECTED]> wrote:
> should clone also work for behaviors that were not added by jquery?
> (like a google map?) i tried
What version of jQuery are you using? Are you getting an error
message? Are you trying to clone a table row? jQuery 1.2.2 has a known
issue with cloning a table row and a few other elements. The current
SVN and jQuery 1.2.3a resolves this issue. Please try using jQuery
1.2.3a to see if that resolv
you said your code copied the element correctly, but mine is not. do you see
anything wrong with my code that would make my element it should be coping
to data empty?
chrismarx wrote:
>
>
> should clone also work for behaviors that were not added by jquery?
> (like a google map?) i tried to
should clone also work for behaviors that were not added by jquery?
(like a google map?) i tried to clone a div with a google map, and
although clone successfully copied all the elements, the behaviors
were lost. append did the job for a workaround. should clone(true) be
able to also grab all the
Check out this ticket and the proposed patch to see if it fixes your
problem.
http://dev.jquery.com/ticket/2184
David
On Jan 22, 4:36 pm, Jason Davies <[EMAIL PROTECTED]> wrote:
> Does anyone know of a workaround?
>
> Jason
>
> On Jan 21, 3:37 pm, Leu <[EMAIL PROTECTED]> wrote:
>
>
>
> > Yes th
Does anyone know of a workaround?
Jason
On Jan 21, 3:37 pm, Leu <[EMAIL PROTECTED]> wrote:
> Yes there seems to be a problem.
> Here is an example what doesn't work in IE7 (don't know about IE6) but
> works in FF.
>
> row = $('#protoRow');
> ...
> clonedObject = row.clone(true);
>
> After the cl
Yes there seems to be a problem.
Here is an example what doesn't work in IE7 (don't know about IE6) but
works in FF.
row = $('#protoRow');
...
clonedObject = row.clone(true);
After the clone() call, working with the object "clonedObject" doesn't
work anymore, for example:
clonedObject.find('td:
On Jan 16, 6:16 pm, John M Lauck <[EMAIL PROTECTED]> wrote:
> Is there an issue using clone() in IE7? I'm not having trouble in
> Firefox 2 but IE7 seems to ignore this method.
I'm having a problem with this too: calling row.clone(true) causes a
"'nodeType' is null or not an object" error in IE7
thank you but about remove()?
where do I use it>
- Original Message -
From: "KidsKilla .grin! wuz here" <[EMAIL PROTECTED]>
To:
Sent: Thursday, January 17, 2008 9:14 AM
Subject: [jQuery] Re: clone help
> $('#$id').remove().clone(true).appendTo('
$('#$id').remove().clone(true).appendTo('#verticals');
is wrong. because of remove() (it kills everything because of memory IE leaks).
you sould use this chain instead:
$('#$id').appendTo('#verticals');
or somethin like that:
$('#$id').hide().bla-bla.appendTo('#verticals').show();
2008/1/17, Li
Hi Lionel,
It looks like you replied to another email message to this group and
simply changed the subject line. Unfortunately, people who use a
"thread view" in their email programs may ignore your message because
it will appear in the same "thread," or group, of messages that
they've a
I decided it was best to not use clone in my situation, I used append
instead.
I would append the html onto a div, assigning it a unique id each
time.
Then I deleted the item based off that id.
Seems to work great, plus a great way to add extra fields to a
form. :-)
On Jan 8, 8:46 pm, Karl Swe
Do you mean removing an item that has been cloned and then inserted
into the DOM? It's easy to do with .remove(), but you'll need to bind
the event handler after the element has been inserted. Details here:
http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_afte
Antonio,
I am trying something similar. I copied your code but it does not
work. Is there something missing from the post?
On Dec 16 2007, 9:44 am, Antonio Jozzolino
<[EMAIL PROTECTED]> wrote:
> Everything works fine now. Thanks a lot!
>
> html
>
>
> Empresas Coligadas o
Everything works fine now. Thanks a lot!
html
Empresas Coligadas ou Filiais
js
$('span.bt-more').bind('click', function(){cloneDiv($(this))});
$('span.bt-less').bind('click', function(){removeDiv($
Thanks David, Richard and Bryan
I have try with "insertAfter" and this work fine.
But I need to bind a event again in new button that will be created.
HTML
Empresas Coligadas ou Filiais
JS version 1
/*$(
Antonio, try something like this:
$('span.bt-more').bind('click', function(event){
var span = event.target || event.srcElement;
var $parent = $(span).parent();
$parent.after($parent.clone());
});
If my understanding of the 'this' keyword is correct, in your
anonymous clic
I think you want insertAfter(e), instead of after(e). Your after(e) call is
trying to move 'e' to be after its clone, which is disconnected from the
DOM, floating if you will. That's why you're getting 'this.parentNode has no
properties'
- Richard
On Dec 15, 2007 7:34 PM, Antonio Jozzolino <[EMAI
Thanks, David, but it don't work too:
this.parentNode has no properties
e(div.add-more)jquery-1.2.1.pack... (line 11)
e()jquery-1.2.1.pack... (line 11)
e([div.add-more], function(), undefined)jquery-1.2.1.pack... (line 11)
e()jquery-1.2.1.pack... (line 11)
e([div.add-more], function(), undefined)
At least one error is here:
var e = $(this).parent()[0];
should be just
var e = $(this).parent();
You were converting the jQuery object to a DOM object then trying to
run jQuery methods on it.
David
On Dec 15, 2:04 am, Antonio Jozzolino <[EMAIL PROTECTED]>
wrote:
>
>
BTW: you are missing a final ")"
Haha, ok it's official - I suck. Or at least am not allowed to paste
code in here that I haven't at least given a quick firebug trial ; ).
1) I tried to replace my version with it and it didn't work. I did add
in the $.clone(xxx,true) to my code. It wasn't obvi
BTW: you are missing a final ")"
2 comments :
1) I tried to replace my version with it and it didn't work. I did add
in the $.clone(xxx,true) to my code. It wasn't obvious why it didn't
work.
2) Speed. Cloning can be quite slow due to the recursion. Is it
possible to move the jQuery specific s
Sry for spamming the list, but I just spotted another error (that's
what you get when doing quick refactorings for posting stuff in public
without testing them properly ^^). Full code again / last post:
$.extend({
clone: function(obj, deep) {
// Clone a jQuery object / obj
Ups, that last line should read:
return obj;
not 'return clone;'.
On Aug 5, 7:30 pm, Felix Geisendörfer <[EMAIL PROTECTED]> wrote:
> My function for cloning looks like this: It covers objects, arrays,
> functions and jQuery objects / custom objects with an own clone() function:
>
>
My function for cloning looks like this: It covers objects, arrays,
functions and jQuery objects / custom objects with an own clone() function:
--
$
It does work for array's, only they come back as objects !!
having said that - your approach looks better :)
On Aug 5, 5:41 pm, "Erik Beeson" <[EMAIL PROTECTED]> wrote:
> Thanks for sharing this. I'm pretty sure what you suggest won't properly
> deal with arrays. Objects aren't the same as arr
Thanks for sharing this. I'm pretty sure what you suggest won't properly
deal with arrays. Objects aren't the same as arrays. Here's how I do
something like that:
function deepCopy(obj) {
if(obj && obj.constructor == Object) {
var newObj = new Object();
for(var fiel
Thanks, elegant solution !
X+
On Apr 13, 11:58 am, Klaus Hartl <[EMAIL PROTECTED]> wrote:
> xavier schrieb:
>
> > Hi,
>
> > When I clone an element that has an accesskey, it's copied to the
> > cloned element as well.
>
> > Then you end up with two different elements having the same accesskey.
>
xavier schrieb:
Hi,
When I clone an element that has an accesskey, it's copied to the
cloned element as well.
Then you end up with two different elements having the same accesskey.
Obvioulsy no good.
Do I have to call .removeAttr('accesskey') method on each cloned node
or is there a better wa
81 matches
Mail list logo