Print Single DIV?
Dec 12, 2005
I'd like to provide users with a simple button that would trigger the printing of the contents of a specific DIV - a lot of searching has yielded nothing very useful... Any bright ideas out there? Many thanks.
Ah, before I forget: it should obviously be cross-browser compatible...
Double ah... before I forget another thing: hiding "the other DIVs" before printing is not really the cleanest way of doing things... Ideally, one should be able to specify the DIV to print..
View 3 Replies
ADVERTISEMENT
Jun 27, 2007
I have a requirement to print particular area of a web page. Web page has many div's and one iframe in it. I need to print a div and iframe content with one single print command. I am able to do so but then two print dialog boxes come up when the print command is given. I have written a javascript function to achieve this.
I did find a solution to this but then I do not understand why onload fails to work in this scenario. I am summarizing steps I had followed.
1) Read the contents of div using innerHTML and store it to a variable.
2) Read the contents of iframe and store it to a variable. "Details" is id of the iframe.
var iframeObj = document.getElementById("Details");
var iframeDoc;
frameDoc = iframeObj.contentWindow.document;
3) Open a window and write all these content after writing these few lines
flashDivWindow.document.write('<html><head><title>Print page</title></head><body onload="javascript:window.print()">');
When I view the source all HTML code can be seen as expected, however this doesn't trigger onload event. I need to refresh the page for print to happen, some thing which isn't practical. Using Javascript reload doesn't help as print is invoked even before the page content is reloaded.
View 2 Replies
View Related
Aug 13, 2009
I am using window.print() for print the web page, its working fine but i want more than one copy each and every time the the window will pob and ask me to select the printer name instead of that i want to pass the printer name through code if possible to print like this.
View 2 Replies
View Related
Dec 18, 2009
I am code a printing report web application, the report is simplest display on HTML form and using window.print() to print it out.
The report can be vary to 2 or more page depend the no. of record retrieved. I have a idea to print multiple page with user single click. Any method to make it real?
View 3 Replies
View Related
Jul 3, 2007
I would like to print a Web page with javascript method window.print() without pages number and footer.
View 7 Replies
View Related
Aug 30, 2011
Can I configure this function to make it print a certain pixel only?
Around 500px X 700px Center.
CODE:
Is it possible?
View 1 Replies
View Related
Apr 7, 2006
I'm trying to create a print link that sends the page to the printer without opening the print dialog box on the browser.
I know that window.print() will open the print dialog and then the user has to click OK.
is there anything that can do this?
View 1 Replies
View Related
Jul 21, 2009
I'm facing a different problem.
I'm having a long page where there will be content to be printed.
I'm using the css using media=print to hide all the unwanted contents and using the window.print method to invoke printing.
But when i click the print button it prints only partial content upto a single page and all the remaining contents are discarded.
I wonder what may be the problem!!!
And there's another problem , i've bills to be printed in order but dont want them to be breaking in between pages .(ie a bill should be printed fully if there is enough space at the bottom or should be printed on the next page)
How can i do both of this?
View 3 Replies
View Related
Jan 3, 2002
Hey all. I am currently putting together a test page of mine where a popup window comes up showing a coupon that I will have a link enabling them to print it simply and easily.
For my current code I have a simple <a href="javascript:window.print()"> that works great on both Internet Explorer 5 and Netscape 4/6 on the PC but for some reason, Internet Explorer 5 for Macintosh doesn't do a thing.
View 2 Replies
View Related
Jul 20, 2005
Is it possible to do an ie print from javascript that does not bring
up the print dialog? I'm in a situation where i need to load a
sequence of files into a browser and print all of them without any
user interaction.
View 3 Replies
View Related
May 1, 2009
Is there a way to get a print preview triggered by a button rather than just print?
<input type="button" name="print" value="Print" onClick="document.print();">
Unfortunately, the WebBrowser.execWB(7) functionality doesn't work in FF3.
Any idea using good old fashion JavaScript or jQuery?
View 1 Replies
View Related
Jun 22, 2007
So I have a print page that's written in a combination of php & html. The body tag is outside the php with an onload="window.print();window.close;"
The idea behind this print page is when the print button is pressed on the parent window, it generates this child window that is specifically made larger for printing reports that people can read easily. I use css for text styles and the table "width" is longer.
All the html code inbetween the body tags is created by php using the php "Print" function.
</head>
<body class="page" onload="window.print();window.close;">
<?php
Print "<table width=1600 border=1 cellpadding=0 cellspacing=0 class=page>";
Print "<tr bgcolor=cbe5ff>";
Print "<td width=30>WO #</td>";
// yada yada yada
?>
My problem is it does not print the table dimension or the font size above a certain size. When I print in landscape, which is what this page is designed for, it prints the same size as "scaled to fit" portrait. On the screen the size is correct and if I use the browser print button, it prints to the correct size.
The css works, it will make changes and will even make the text smaller just won't print over a certain size (9pt?).
View 1 Replies
View Related
Feb 15, 2009
I want have two iframes in a single php page and I print them using two print methods. May I know how to print the both iframes using a single print method?
View 6 Replies
View Related
Jul 23, 2005
Is it possible to print [using window.print()] a page that has no "title"
and "page number" on the top and no "link adress" and "date" on the bottom
(to print just a page just as it is...)?
View 2 Replies
View Related
Jul 23, 2005
If I do the following, it will pop up print dialog. But i want to produce
"File->Print Preview" Screen. Is it possible to do that?
<input type="button" value='Print Preview' onClick='window.print();'>
View 1 Replies
View Related
Apr 29, 2010
I have an asp form where one field has potential for entry of single quote (usually a possessive -bob's-).How can I replace "'"with "`" before it is passed forward generating an error.
View 6 Replies
View Related
Dec 14, 2007
I'm having some problem trying to escape single quotes. basically, I got some text on the database. if text contains double or single quotes, these are replaced with " and ' respectively. I'm using PHP to alert a portion of the text, let's say "hello, y'all!", this way:
PHP Code:
<?php
echo '<script type="text/javascript">'
echo "alert('hello, y'all!');";
echo '</script>'
?>
well, the js code breaks, just as if ''' were converted to the 'single quote' character. how so?
View 4 Replies
View Related
May 11, 2001
can anyone tell me why this never works in IE 5 on mac
<a href="#" onmousedown="javascript:window.print()"><img src="print.gif" width="25" height="20"></a>
and no problem on netscape, is there a solution for IE mac?
View 3 Replies
View Related
Apr 28, 2010
The following hides all divs. What if I want to hide only one div? Specifically the one with the word TEXT.<div ><div id="hide">TEXT</div><input type="button" value="Hide" /> </div>With this in the header:$(document).ready(function(){$("button").click(function(event){$("#hide" ).hide("slow");});});if I change #hide to div then it hides all the divs, which is not what I want.
View 5 Replies
View Related
May 19, 2009
I found a good solution to make a complete table row clickable:
<tr link="/folder/here.php">.....
$("tr[link]").bind("click", function(){
var link = $(this).attr("link");
window.location.href = link;
});
Only problem in my case: My tbale has as first <td> a checkbox to select my products. How can I change the jquery above to exclude a <td> containing a <input type="checkbox"....>?
View 2 Replies
View Related
Oct 6, 2010
greetings i am using quite a few different js plugins for my websites, and recently i have come into a problem with my <li> tag i have two menus that are using it and need two distinct css codes for them.
can i make two different css for li or inline code them what are my options? problem in a nutshell. main menu with one set of css <li> gallery images also using <li> the css of the gallery is conflicting and completely ruining the <li> for the main menu.
View 1 Replies
View Related
Oct 9, 2010
Is it possible to preload a single div with jquery? or simple Javascript?
View 8 Replies
View Related
Aug 20, 2009
How can I add single quotes around listObj.options[i].value. I still want to keep the comma I'm adding to the end of it. code...
View 1 Replies
View Related
Aug 20, 2009
How can I add single quotes around listObj.options[i].value. I still want to keep the comma I'm adding to the end of it. code...
View 1 Replies
View Related
Jun 8, 2011
I am trying to make a JavaScript chat-bot
I was using this to answer a month questions and it worked fine for what is the month after
DatesA=new Array("january,February","february,March","march,April","april,May","may,June","june,July","july,August","august,September","september,October","october,November","november,December","december,January");
[Code]....
The bot correctly answers for x y and z . It then answers V for all other letters, digits and short words
What is the letter before cow
answer: V
View 2 Replies
View Related
Jul 2, 2011
I have my link [url]. Basically I have two buttons one Add Single and one Add Double. When I press Add Single I want to have a new row with the single drop down list. On the other hand when I press the Add Double I want to have a new row with the two drop drop down list.
View 8 Replies
View Related