Help printing a image from a repeating group

I am trying to use an html button in a repeating group to print the image in the group. Below is the html I am using in the button. When we I click the print button it opens the print preview box but it just show “undefined” on the print preview.

The Div content which you want to print

Is there a easy html way to print from a repeating group? Thanks

Sorry this is the html code

<input name="b_print" type="button" class="ipt"   onClick="printdiv('div_print');" value=" Print ">

<div id="div_print">

<h1 style="Color:Red">The Div content which you want to print</h1>

<script language="javascript">
function printdiv(printpage)
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;
document.body.innerHTML = oldstr;
return false;

This topic was automatically closed after 70 days. New replies are no longer allowed.