Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Making a Print Button

Status
Not open for further replies.

elise28

Programmer
Mar 2, 2003
12
SG
Hi,
Need to check out how to make a print button?

I have tried to make a function as below:
<script language=&quot;JavaScript1.2&quot;>
function Toprint() {
Window.Print();
}
</script>

<input type = &quot;button&quot; onClick = &quot;Toprint()&quot;
value = &quot;Print&quot;>

...that all..
I not very sure how it shld be done..do i need to reite another printable version page in order to re-direct user to there and print from there?
Or can user just print the copy upon clicking the print button?
 
Hi
You don't have to redirect them to a printable version page. Some sites do that do get rid of unwanted bits, frames, etc to make it look better when printed, but that depends on your content. Or you can use stylesheets to make two versions, one for printing and one for viewing.
The bottom line: See how it looks when you print and decide if you want to do anything with it. [smile] Hope I helped / Thanks for helping
if ((Math.abs(x)<10&&Math.abs(y)<10) && (((parseInt(Math.abs(x).toString()+Math.abs(y).toString())-Math.abs(x)-Math.abs(y))%9)!=0)) {alert(&quot;I'm a monkey's uncle&quot;);}
 
also note that javascript is case-sensitive, and this will cause an error:
Window.Print();

it should be
window.print();
=========================================================
while (!succeed) try();
-jeff
 
Thanks to jemminger and HellTel.
window.print(); works but one of the field is using textarea and when printed out, it didn't manage to print the full length description.

<TEXTAREA style=&quot;HEIGHT: 54px&quot; name=description rows=3 wrap=VIRTUAL cols=75><cfoutput>#view.descpt#</cfoutput></TEXTAREA>

That's the one show above. I'm not sure whether it's because my computer setting is too large which cause it to be out of line when printed out.

Hence any solution to that?
Thks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top