0

Hi Guys,
I'm trying to make an option on my site where visitor could select certain image(s) to print.
Here is the closest code, I've found.
http://javascript.internet.com/misce...elds-only.html

I'm not good in Javascript to write the code. I would appreciate any help.

Here is my approximate code.

<a href="#">Print selection</a>
<br>
<br>


<input type="checkbox" name="checkbox" id="checkbox">Select to print<br>
<img src="images/1.gif" width="600" height="400" /> <br>

<input type="checkbox" name="checkbox" id="checkbox">Select to print<br>
<img src="images/2.gif" width="600" height="400" /> <br>

<input type="checkbox" name="checkbox" id="checkbox">Select to print<br>
<img src="images/3.gif" width="600" height="400" /> <br>

<input type="checkbox" name="checkbox" id="checkbox">Select to print<br>
<img src="images/4.gif" width="600" height="400" /> <br>

<input type="checkbox" name="checkbox" id="checkbox">Select to print<br>
<img src="images/5.gif" width="600" height="400" /> <br>

<input type="checkbox" name="checkbox" id="checkbox">Select to print<br>
<img src="images/6.gif" width="600" height="400" /> <br>

<input type="checkbox" name="checkbox" id="checkbox">Select to print<br>
<img src="images/7.gif" width="600" height="400" /> <br>

<input type="checkbox" name="checkbox" id="checkbox">Select to print<br>
<img src="images/8.gif" width="600" height="400" />

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by vau3677
0

Thank you for the links, but the code still does not work the way i need.
What I need is pretty close to the code below, but i want it to be applied to about 8 images stocked in a column. I'm not so good in Javascript to recode the code.
Any help, please...

<style type="text/css">
@media print {
  .DONTPrint { display:none}
  .DOCheck { display:table}
}
</style>
<script type="text/javascript">
function select_row(row, color) {
  if(row.parentNode.parentNode.style.backgroundColor != color) {
    row.parentNode.parentNode.style.backgroundColor = color;
    row.parentNode.parentNode.className = 'DOPrint'
  } else {
  row.parentNode.parentNode.style.backgroundColor = '';
  row.parentNode.parentNode.className = 'DONTprint'
  }
}

function mouseover(row, font_color, checkedcolor) {
  if(row.style.color != checkedcolor) {
    row.style.color = font_color;
  }
}

function mouseout(row, font_color, checkedcolor) {
  if(row.style.color != checkedcolor) {
    row.style.color = font_color;
  }
}
</script>
<form>
  <table width="129" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td width="43" align="center"> </td>
      <td width="86" align="center"><strong>Name</strong></td>
    </tr>
    <tr onmouseover="mouseover(this,'#cc6600','#cc6600');" onmouseout="mouseout(this,'#000000','#000000')" class='DONTPrint'>
      <td><input type="checkbox" name="checkbox1" onclick="select_row(this, '#cccccc');"></td>
      <td>Arnold </td>
    </tr>
    <tr onmouseover="mouseover(this,'#cc6600','#cc6600');" onmouseout="mouseout(this,'#000000','#000000')" class='DONTPrint'>
      <td><input type="checkbox" name="checkbox1" onclick="select_row(this, '#cccccc');"></td>
      <td>Garth</td>
    </tr>
  </table>
</form>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.