I am showing the values from a database in a table format in a php page. i want to print the data on the page with a custom print button. without accessing the database data again. how it is possible?
Here is an example of a print button I included in an order form for one of my clients:
Code:
<p>Fill out this entire form,
<script type="text/javascript">
<!--//
if (!window.print) document.write('print');
else document.write('<input type="button" name="print" value="Print" ',
' title="Click to open print dialog box." ',
' onclick="window.print(); return true;">');
//-->
</script>
it, and mail the two printed pages to:</p>
Thank u very much. Now my problem is that window.print is printing everything on screen. i want only some informations like selected portions excluding header footer etc. ie, the values inside a particular area in the screen. which will be inside a table or like anything. so how can it be donw? shall i seperate the printable portion with some tags like <print> and end with <print>. then how can i do it?
Please post the URL for your page so we can see exacty what's going on.
The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.
Tim Berners-Lee, W3C Director and inventor of the World Wide Web
no, it isnīt still in the web, but it is on my PC, and the question is basic.
With this javascript code i need to add a button?? and, if i do, what should the button say?? on click="?" <---- in the ? is where i donīt know. Or this code work alone, doesnīt it need something to do the action?
Again i am sorry for this question, but i don get it
I would like to add to this code a validation function but i need that if the validation is not good it wouldnīt print. I already have the validation function, that is not a problem, but i donīt know where to put it because I donīt undestand completly that if in this code.
if you could tell me where should i put my function i would be gratefull.
so i need to put my function "validate" some how so it will validate my form and if the validaton is not good it will not print.
my validate function goes like this
Code:
<script language="JavaScript">
function validate(form) {
if (form.nombre.value.length < 4) {
alert("Escriba por lo menos 4 caracteres en el campo \"Nombre\".");
form.nombre.focus();
form.nombre.select(); ....
The code of javascript "validate" is not complite in this post and neither is the html code that shows the form, but it is long but similar to the part i write.
Bookmarks