rsrinc
12-11-2002, 10:09 PM
I'm wondering how I may go about this. I want to make a form.. click the boxes. I want it to do something a little different. When the click the option 'party' I want a button at the bottom 'Print Form'. Then it prints out the form for the party. But, without seeing it first. Same with the other options. I just want them to choose what form they want and have it print. Anything?
rsrinc
12-12-2002, 12:00 AM
So no one here knows either. I'm stumped. Looks like you are, too.
AdamGundry
12-12-2002, 01:51 PM
You can only print visible documents, so you would need to open a new window for the party form then print it.
Have a button wherever you like on the page, set to display: none, as shown below, with an onclick event handler calling a function.
<input name="partybutton" id="partybutton" type="button" value="Print Form" onclick="PrintForm('party.html');" style="display: none">
<script type="text/javascript">
function PrintForm(url){
window.open(url,formwin);
formwin.print();
formwin.close;
}
</script>
In order to display the button, use partybutton.style.display = 'inline'.
I haven't tested this, but it should work with some minor tweaks. You can use different url properties for each button, calling the same function, or could probably extend the script so only one button is used.
Good luck
Adam