[jQuery] append can not with form submit for IE
hi all !
i usage jquery appent 2 radio group to form. It work when submit in FF
but does't work in IE.
My code
function checklistPanel (type, id,url){
var memory = false;
var str = new String();
var newId = id.substr("1")+'-new';
var newIdo = id+'-new';
var currId = id.substr("1")+'-curr';
var currIdo = id+'-curr';
var button = new String();
var width = new Number();
var rows = new Number();
var title = $(id).text();
$(id).click(function(){
if(memory == true)
{
return false;
} else if(memory == currIdo)
{
$.blockUI({ message: $(currIdo)[0], css: { width: width+'px',
marginLeft: '-'+(width/2)+'px' }, overlayCSS: { background: "#333",
opacity: 0.7 } });
return false;
} else
{
$("#et-search-main").block({ overlayCSS: { opacity: 0.4,
backgroundColor: "#fff" } });
memory = true;
$.getJSON(url,
function(data){
width = (data.width == null || data.width == 0) ? 300 :
data.width;
rows = (data.rows == null || data.rows == 0) ? 3 : data.rows;
$.each(data.items, function(i,item)
{
if(type == "select")
{
if(i == 0)
str += '<tr>';
if((i%rows) == 0)
str += '</tr><tr>';
str += ' \
<td> \
<label for="'+data.name+item.id+'"> \
<input name="'+data.name+'[]" type="checkbox" id="'+data.name
+item.id+'" value="'+item.id+'" title="'+item.title+'" /> \
'+item.title+' \
</label> \
</td>';
if((i+1) == data.total)
str += '</tr>';
}
else if(type == "radio")
{
if(i == 0)
str += '<tr>';
if((i%rows) == 0)
str += '</tr><tr>';
str += ' \
<td> \
<label for="'+data.name+item.id+'"> \
<input name="'+data.name+'" type="radio" id="'+data.name
+item.id+'" value="'+item.id+'" title="'+item.title+'" /> \
'+item.title+' \
</label> \
</td>';
if((i+1) == data.total)
str += '</tr>';
}
});
if(type == "select")
{
button = ' \
<div class="et-checklist-checkall" id="et-checkall" title="<div
class=\'et-tooltip-wrapper\'> \
<div class=\'et-tooltip\'>Check alll</div> \
</div>"> \
</div> \
<div class="et-checklist-uncheckall" id="et-uncheckall"
title="<div class=\'et-tooltip-wrapper\'> \
<div class=\'et-tooltip\'>Uncheck all</div> \
</div>"> \
</div>';
}
$(id).parent("<td>").append(' \
<div class="et-checklist-wrapper" id="'+currId+'"
style="width:'+width+'px"> \
<div class="et-checklist-box clearfix"> \
<div class="et-checklist-title">'+title+'</div> \
<div class="et-checklist-right clearfix"> '+button+' \
<div class="et-checklist-close" title="<div class=\'et-tooltip-
wrapper\'><div class=\'et-tooltip\'>Close panel</div></div>"> \
</div> \
</div> \
</div> \
<div class="checklist-options clearfix" id="'+newId+'"> \
<table border="0" width="100%" cellpadding="0" cellspacing="0">
\
'+str+' \
</table> \
</div> \
</div>');
$.blockUI({ message: $(currIdo)[0], css: { width: width+'px',
marginLeft: '-'+(width/2)+'px' }, overlayCSS: { background: "#333",
opacity: 0.7 } });
$(currIdo+" .et-checklist-close").click(function()
{
memory = currIdo;
closeChecklistPanel(currIdo);
$.unblockUI();
}
);
$("#et-search-main").unblock();
$(currIdo+' .et-checklist-close, '+currIdo+' #et-checkall,
'+currIdo+' #et-uncheckall').tooltip({
track: true,
delay: 0,
showURL: false,
showBody: " - ",
fade: 250
});
if(type == "select")
{
$(currIdo+" #et-checkall").click(function()
{
$(currIdo+" input:checkbox[@type=checkbox]").attr('checked',
true);
displayChecklistPanel(type,id,title,newId);
}
);
$(currIdo+" #et-uncheckall").click(function()
{
$(currIdo+" input:checkbox[@type=checkbox]").attr('checked',
false);
displayChecklistPanel(type,id,title,newId);
}
);
$(newIdo+" input:checkbox").click(function()
{
displayChecklistPanel(type,id,title,newId);
}
);
} else if(type == "radio")
{
$(newIdo+" input:radio").click(function(){
displayChecklistPanel(type,id,title,newId);
});
}
});
}
});
}
function displayChecklistPanel (type,id,title,newId)
{
var val = [];
var titVal = new String();
if(type == "select") {
$('#'+newId+' input:checkbox[type=checkbox]:checked').each(function
(i){
val[i] = $(this).attr("title");
});
if(val.length > 0)
{
$(id).html(val.join(", "));
} else {
$(id).html(title);
}
}
else if(type == "radio")
{
$('#'+newId+' input:checked').each(function(i){
titVal = $(this).attr("title")
});
$(id).html(titVal);
}
}
function closeChecklistPanel (currIdo)
{
$(currIdo).hide();
}
// call function
checklistPanel("radio","#et-package","./form.php?act=package");
please help me a way