Hi,
I need help with the function print..
I have a page with images, with a button print that opens me a news window, with 3 options:
1 – Print actual image
2 – Print all images
3 – Print images break
After choosing the option I have a button that should print
my choice… but not..
This it is my code:
<html>
<head>
<title>Página de Impressão</title>
<script language=”JavaScript”>
var x = new Array();
function carrega_array(){
n_imp = window.opener.Navegacao.n_pag.value;
t_imp = window.opener.Navegacao.t_pag.value;
total_imp = window.opener.Navegacao.total_pag.value;
array_imp = window.opener.Navegacao.array_act.value;
window.opener.reg_url10();
tmp = window.opener.image_arrayI[n_imp];
tmp = window.opener.image_arrayD[n_imp];
}
function Print_Pages(){
x = window.opener.image_arrayI[n_imp];
window.document.image_arrayI[n_imp].print();
}
function print_onclick(TheButton) {
ClickedButton=TheButton.value;
switch(ClickedButton){
case “G”: {
caixa.style.display=”block”;
Gestor.T1.focus();
break;
}
default : caixa.style.display=”none”;
}
}
</script>
</head>
<body bgcolor=”#FFFFFF” onload=”carrega_array()”>
<center>
<table cellSpacing=”0″ cellPadding=”0″ border=”0″ width=”315″>
<tbody>
<tr>
<td width=”50″>
<img src=”
<td class=”Fontes5″ width=”250″>Serviço de Impressão</td>
</tr>
<tr>
<td colspan=”2″ class=”Fontes4″>________________________________________</td>
</tr>
</tbody>
</table></center>
<center>
<form name=”Gestor” method=”POST” action=”
<input type=”hidden” value=”x” name=”text_ficheiro”>
<table cellSpacing=”0″ cellPadding=”0″ width=”315″ border=”0″>
<tbody>
<INPUT TYPE=”hidden” NAME=”n_imp” VALUE=””>
<INPUT TYPE=”hidden” NAME=”t_imp” VALUE=””>
<INPUT TYPE=”hidden” NAME=”total_imp” VALUE=””>
<INPUT TYPE=”hidden” NAME=”int_imp” VALUE=””>
<INPUT TYPE=”hidden” NAME=”array_imp” VALUE=””>
<INPUT TYPE=”hidden” NAME=”text_ficheiro” VALUE=””>
<tr>
<td width=”205″ style=”border-style: none; border-width: medium”>
<input id=”fp1″ onclick=”print_onclick(this)” type=”radio” value=”C” checked name=”R1″>
<label for=”fp1″ class=”Fontes4″>Imprimir a página actual</label>
</td>
<td width=”110″ align=”middle” style=”border-style: none; border-width: medium”>
<input type=”submit” value=” Imprimir ” name=”B1″ onclick=”Print_Pages()” class=”BPRINTBLUE”>
</td>
</tr>
<tr>
<td width=”315″ colspan=”2″ style=”border-style: none; border-width: medium”>
<input id=”fp2″ onclick=”print_onclick(this)” type=”radio” value=”T” name=”R1″>
<label for=”fp2″ class=”Fontes4″>Imprimir o diário completo</label>
</td>
</tr>
<tr>
<td width=”205″ style=”border-style: none; border-width: medium”>
<input id=”fp3″ onclick=”print_onclick(this)” type=”radio” value=”G” name=”R1″>
<label for=”fp3″ class=”Fontes4″>Imprimir grupo de páginas</label>
</td>
<td width=”110″ style=”border-style: none; border-width: medium”>
<div id=”caixa” style=”width: 110; display:none”>
<label for=”fp4″ class=”Fontes4″>de </label>
<input type=”text” name=”T1″ size=”2″ id=”fp4″>
<label for=”fp5″ class=”Fontes4″>a </label>
<input type=”text” name=”T2″ size=”2″ id=”fp5″>
</div>
</td>
</tr>
</table></form></center>
<script>
Gestor.text_ficheiro.value = window.opener.image_arrayI[n_imp];
</script>
</body>
</html>
What can I do?
Thanks