Dear friends,

I have created one form to search the data from the database. the form is having four text button to get input for search. if the search criteria matches, it will display the results on next page.
But I want to print while giving the input data in form as well as I have to print the page with out showing the results of the those input.
I am using php and MySQL for back end. and java script using for window.print();

Please help me,

can you explain a little bit more ?

I have created one form, that contains four text fields. (like date,name, age,location). and I have entered the values to database called "details".

Now I want to print the using print button. when I use to click the print button, it takes the result page to printer and give me printed copy.

the form does not shows the result page, it submits the result values to printer.

give me idea to solve this problem.


You mean like this ?

<script type="text/javascript">
function printpage() {
	return false;
<form onsubmit="javascript: return printpage();">
This is the result page. 
<INPUT TYPE="submit" name="submit" value="Print">

Presently I am using this method. Now I am getting print of form only. I want to take a print copy of result page.

Presently I am using this code:

function print_page() 
<td ><INPUT type="button" name="print" value="PRINT" class="button" onClick="printpage()"> </td>

give me suggestion.

why don't you have the same thing in your result page ?

Thanks, I have implemented the print option. But I am getting the output result that exceeds the page.

I mean here, to see the entire page we have to use horizontal scroll then only we view all data. the print option will take output only the screen size. how can I print all the data as per original output.

whether we have option to print all in a single page or only we get print as the screen shows.

suggest me please,

I tried with that way. But I get print the same.

or else how we set the print page to Landscape.

<input type="button" value="Print this page" onClick="window.print()">

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.