Posted in DOM, JQuery

Windows print

function printPage() {

window.onbeforeprint = $(“#btnPrintMyPDF”).hide();
window.onbeforeprint = $(“#labelchart”).hide();

window.onbeforeprint = $(“#label__CHART_N”).hide();
window.onbeforeprint = $(“#_CHART_N”).hide();

window.onbeforeprint = $(“#label__CHART_B”).hide();
window.onbeforeprint = $(“#_CHART_B”).hide();

window.onbeforeprint = $(“#label__CHART_R”).hide();
window.onbeforeprint = $(“#_CHART_R”).hide();

window.onbeforeprint = $(“#btnShowChart”).hide();

window.print(); 

window.onafterprint = $(“#btnPrintMyPDF”).show();

window.onafterprint = $(“#btnPrintMyPDF”).show();

window.onafterprint = $(“#labelchart”).show();

window.onafterprint = $(“#label__CHART_N”).show();
window.onafterprint = $(“#_CHART_N”).show();

window.onafterprint = $(“#label__CHART_B”).show();
window.onafterprint = $(“#_CHART_B”).show();

window.onafterprint = $(“#label__CHART_R”).show();
window.onafterprint = $(“#_CHART_R”).show();

window.onafterprint = $(“#btnShowChart”).show();

}

WindowsPrint.png

Posted in JQuery

Zebra_form checkbox manipulations

function evalAttributes () {

$(“#_YN_Y”).removeAttr(“disabled”);
$(“#_COMMENTONLY_Y”).removeAttr(“disabled”);

// ———————————————-

if ($(‘#_YN_Y’).prop(‘checked’)){

$(‘#_COMMENTONLY_Y’).prop(‘checked’, false);
$(“#_COMMENTONLY_Y”).attr(“disabled”, true);

}

// ———————————————-

if ($(‘#_COMMENTONLY_Y’).prop(‘checked’)){

$(‘#_YN_Y’).prop(‘checked’, false);
$(“#_YN_Y”).attr(“disabled”, true);

}

}

Posted in JQuery, zebra_form

A zebra_form check box

YesNoCheckBox

// — _YN ———————————————————————

$form->add(‘label’, ‘label_yn’, ‘_YN’, ‘CESYesorNoonly’);

$obj = $form->add(‘checkbox’, ‘_YN’, ‘Y’);

$obj->set_attributes(array(
‘onclick’ => ‘evalAttributes()’
));

User defined Javascript function

function evalAttributes () {

if ($(‘#_YN_Y’).prop(‘checked’)){

}

}

Template entry

YN_Template