/* 把表单元素转成只读的dom元素 */
function changeFormToViewModeInner(id) { --ID为一个容器,比如panel,div...
$("#" + id).find(":text,:radio,:button,:submit,img,:image,:checkbox,select,textarea").not("[NoHidden]").each(function () {
if ($(this).css("display") == "none") {
return;
}
var tagName = this.tagName.toUpperCase();
if (tagName == "INPUT") {
var type = this.type.toUpperCase();
if (type == 'TEXT') {
//如果是文本框,则隐藏,并显示value文本
$(this).closest("td").prepend($(this).val());
$(this).hide();
} else if (type == 'CHECKBOX') {
//如果是复选框,则设置只读,不隐藏
$(this).attr('disabled', 'disabled');
} else if (type == 'BUTTON') {
$(this).hide();
}
} else if (tagName == "SELECT") {
//如果是下拉框, 则隐藏, 并显示value文本
if ($(this).val() != '') {
$(this).closest("td").prepend($(this).find(":selected").text());
}
$(this).hide();
} else if (tagName == "TEXTAREA") {
$(this).closest("td").prepend($(this).val());
$(this).hide();
}
});
$('.datetime_trigger').hide();
$('#' + id).find('.red-star').hide(); //去掉红色的*
$('#' + id).find('img[src*="icon_dictionary.gif"]').parent().hide(); //隐藏选择按钮
}