function bindData() {
//如果checkbox,radio,select>option的值有變化, 也系結一下, 這里忽略button
$("input,select option").each(function () {
$(this).attr('value', $(this).val());
});
$("input[type='text']").each(function () {
$(this).html($(this).val());
});
// type=checkbox,type=radio 選中狀態
$("input[type='checkbox'],input[type='radio']").each(function () {
if ($(this).attr('checked'))
$(this).attr('checked', true);
else
$(this).removeAttr('checked');
});
//select選中狀態
$("select option").each(function () {
if ($(this).attr('selected'))
$(this).attr('selected', true);
else
$(this).removeAttr('selected');
});
// textarea
$("textarea").each(function () {
$(this).html($(this).val());
});
}
function printdiv(printpage) {
bindData();
var headstr = "<html><head><title></title></head><body>";
var footstr = "</body>";
var newstr = document.all.item(printpage).innerHTML;
var oldstr = document.body.innerHTML;
document.body.innerHTML = headstr + newstr + footstr;
window.print();
document.body.innerHTML = oldstr;
return false;
}
uj5u.com熱心網友回復:
推薦用 lodop列印控制元件uj5u.com熱心網友回復:
這是啥意思啥意思轉載請註明出處,本文鏈接:https://www.uj5u.com/net/113428.html
標籤:VB.NET
上一篇:eclipse打開時候報錯
