can anyone pls help?
problem with printing selected section?
Moderator: General Moderators
problem with printing selected section?
how can we print a selected section?
can anyone pls help?
[/syntax]
can anyone pls help?
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Code: Select all
<form action="" method="get">
This is my name JOHN...
<br /><br />
1.Name :
<br /><br />
2.Age :
<br /><br />
3. Gender :
<br /><br />
<input name="button" type="button" value="print" />
<input name="button" type="button" value="submit" />
</form>- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
OK, I see what you're asking... I think...
Send a different css file to the printer with the media attribute...
This is untested:
web.css
print.css
Send a different css file to the printer with the media attribute...
This is untested:
Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Some Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="styles/web.css">
<link rel="stylesheet" type="text/css" media="print, handheld" href="styles/print.css">
</head>
<body>
<p>This text still gets printed... but, the buttons don't...</p>
<form method="#">
<input type="button" name="button" value="no" class="button">
<input type="submit" name="submit" value="Submit" class="button">
</form>
</body>
</html>Code: Select all
// Web StylesCode: Select all
form .button{
display: none;
}I've tried this but it doesnt work.do i have to make any changes to my print button?if i didn't do the web.css page,will it affect the way the page prints?
Code: Select all
//this is the print button
<input type="button" value="Cetak" onClick="javascript:window.print();" />yes.. .you need to set the class attribute to button
And then do what I said to supply the printer with a different css file with that class's display set to none
web.css
print.css
Does this make sense? Call the two css files in the head section of the html file like this...
Code: Select all
<input type="button" value="Cetak" class="button" onClick="javascript:window.print();" /> web.css
Code: Select all
.button{
/* Standard web styling */
}Code: Select all
.button{
display: none;
}Code: Select all
<head>
<link rel="stylesheet" type="text/css" href="styles/web.css">
<link rel="stylesheet" type="text/css" media="print, handheld" href="styles/print.css">
</head>