/    Sign up×
Community /Pin to ProfileBookmark

Need help with Print…

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=”http://ardes1:7777/web_icons/impressora.gif” border=”0″ width=”45″ height=”45″ align=”middle”></td>
<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=”http://ardes1:7777/pls/plcs8/plcwimg01.print?p_nr=2&p_tp=A&p_lg=VIII&p_sl=1&p_sup=.&p_int_pag=5,6,7,8,9,10,11,12,”>
<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

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@sciguyryanSep 28.2004 — Well, the best way I can think of doing this is loading the choice in a new window and then printing the contents of the window.


RyanJ
×

Success!

Help @anselmo69 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...