Advertisement

12.09.2004 at 05:18AM PST, ID: 21236279
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.8

Javascript printing html without using document.print

Asked by mittelman in JavaScript

Tags: , ,

Hello - Is there a way to print html without using document.print -OR- is there a way to force document.print to print html inside of existing tags?

Let me explain - I have a PERL/CGI script that I am using some basic Javascript to enable onClick and onChange type functionality. The problem is that one of my JavaScript functions needs to print some html, but when using document.print, it over-writes all of the existing html code in the page and ONLY prints out the html the document.print function is printing. I would like this function to print out the html inside of a <div> tag. Here is the JavaScript function that I am using:
***please ignore the print commands at the beginning of the lines, that is the perl prints to print out the JavaScript as well as the \n"; at the end of the line***

    128    print "function print_cim(){\n";
    129    print "  _num = document.myform.number.value;\n";
    130    print "  for(var \$count = 0; \$count < 25; \$count++){\n";
    131    print "     document.write(\"<tr>\")\n";
    132    print "     document.write(\"<td width=20% align=center>\")\n";
    133    print "     document.write(\"<select name=('cim_add'+\$count)>\")\n";
    134    print "     document.write(\"<option></option>\")\n";
    135    print "     document.write(\"<option value='add'>Add</option>\")\n";
    136    print "     document.write(\"<option value='del'>Delete</option>\")\n";
    137    print "     document.write(\"<option value='chg'>Change</option>\")\n";
    138    print "     document.write(\"<select>\")\n";
    139    print "     document.write(\"<td width=25%>\")\n";
    140    print "     document.write(\"<input type='text' size='40' name=('cim_node'+\$count)>\")\n";
    141    print "     document.write(\"<td width=55%>\")\n";
    142    print "     document.write(\"<input type='text' size='80' name=('cim_notes'+\$count)>\")\n";
    143    print "     document.write(\"<td></tr>\")\n";
    144    print "  }\n";
    145    print "}\n";

Thanks for your help!!

~MikeStart Free Trial
 
Loading Advertisement...
 
[+][-]12.09.2004 at 05:29AM PST, ID: 12782856

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]12.09.2004 at 05:39AM PST, ID: 12782995

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]12.09.2004 at 06:04AM PST, ID: 12783217

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: JavaScript
Tags: javascript, print, html
Sign Up Now!
Solution Provided By: mark-b
Participating Experts: 2
Solution Grade: B
 
 
[+][-]05.02.2005 at 05:24AM PDT, ID: 13908335

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]05.06.2005 at 08:06PM PDT, ID: 13949260

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-42