Hello, I'm trying to clone an ASP .NET control. I can get the element
into a javascript variable using the $ method, and I can also inject
it into other dom elements using the inject method, but what I don't
understand is that I can't clone the element, I always get the same
"null id null or not an object" error in ie. Here's the code that I'm
using:
var accordion1833140;
var chatWindow183314 = function() {var chatTitle183314 = '<span
class="window_title">Conversación</span>';
var chatContent183314 = '<div id="accordion1833140">' +
'<h3 id="rt183314" class="post_title_and_date">Responder</h3>' +'<div
id="rf183314" class="reply_form">' +
'<form id="uploadForm183314" name="uf183314" method="post"
enctype="multipart/form-data" runat="server">' +
'<textarea cols="53" rows="5" id="reply_box183314" class="reply_box"></
textarea>' +
'</form>' +
'</div>'+
'</div>';
new MochaUI.Window({
x: 450,
id: 'chatWindow183314',
width: 350,
maximizable: false,
content: chatContent183314,
minimizable: false,
y: 250,
title: chatTitle183314,
scrollbars: false,
resizable: false,
cornerRadius: 10,
height: 335
});
accordion1833140 = new Accordion('#accordion1833140 h3',
'#accordion1833140 div', {
onComplete: function(toggler, element) {
this.accordionTimer = $clear(this.accordionTimer);
MochaUI.dynamicResize($('chatWindow183314'));
}.bind(this)
,
alwaysHide: true,
onStart: function(toggler, element) {
this.accordionResize = function() {
MochaUI.dynamicResize($('chatWindow183314'));
}
this.accordionTimer = this.accordionResize.periodical(10);
}.bind(this)
});
>> THIS PART <<
var uploadControl = $('Subgurim_miUpload');
var uploadButton = $('ctl00_miBoton');
var clonedUploadControl = uploadControl.clone(true,
true).cloneEvents(uploadControl);
uploadButton.setStyle('visibility', 'visible');
uploadControl.inject('uploadForm183314', 'bottom');
uploadButton.inject('uploadForm183314', 'bottom');
clonedUploadControl.inject('div2', 'bottom');
>> THIS PART <<
}