View Full Version : Focus on Print Command
Ben@WEBProp
07-10-2003, 06:58 PM
I'm sure this is one really easy-to-answer question, but I am asking it anyways...
In my print command:
<a href="#" onclick="javascript:window.print();return false" class="dontprintme">Print This Page</a>
What element would I add to focus the print command onto one frame? Now I know that it it supposed to default to the main frame, but when I print something there is a fairly good sized blank row at the top with no content where my banner is...and it doesn't only happen on the first page, but on the second and third and so on and so forth...
I'm thinking that if I can focus the print command onto "target" frame, then the blank area will be smiten...
If you have that code, yahoo! If you don't and you just lecture me on how evil frames are, yaho...I mean...your face is dumb!
-Ben
p.s.-The "your face is dumb" is copyrighten from "Tim" and is meant to not be personal to anyone or anything in this case.
Roy Sinclair
07-10-2003, 08:33 PM
Use:
onclick="top.frames['NameOfFrameToPrint'].print();return false"
--Edit--
It may require:
onclick="top.frames['NameOfFrameToPrint'].focus();top.frames['NameOfFrameToPrint'].print();return false"
Ben@WEBProp
07-10-2003, 09:20 PM
Thanks! That worked like a charm!
But I am now noticing a second problem and I wonder if it is a user-preference problem or if it is curable from a client-side language position.
I guess it's not that big of a deal, but how do you control the header, page number, and footer of a printout? You know, like whenever you print out something from a browser, it says the title in the top-left corner, the page # out of X pages in the top-right corner, and then usually a web address at the bottom of the page. The document that I want to print is something that needs to remain "clean". It will later be faxed out after printation.
Thanks for all the help!:thumbsup:
Roy Sinclair
07-10-2003, 09:31 PM
how do you control the header, page number, and footer of a printout? You know, like whenever you print out something from a browser, it says the title in the top-left corner, the page # out of X pages in the top-right corner, and then usually a web address at the bottom of the page.
This one gets asked a lot and unfortunately the answer is always the same. The browser controls that part and there's nothing it'll let you do to change that.
Ben@WEBProp
07-10-2003, 09:42 PM
Sorry...
But about that whole "worked like a charm" thing? Ya well I published the page for a test-print on another computer and the big-ol-blank spot is still there! I even tried both of your codes, but neither seems to do the trick. Could you try and print it out for me and see how it goes for you? It's http://www.webpropertiesinc.com
Follow the NavBar on the left to Forms>Resident Managers (the password is beta), and find the link that says Fax Cover Sheet. Go there and click on the "Print This Page" text at the top.
Thanks!
-Ben
Roy Sinclair
07-10-2003, 10:15 PM
It printed fine for me. Only the frame with the Fax information printed and it filled the top of the printed page though the est of the page was blank but that was expected.
Ben@WEBProp
07-10-2003, 10:37 PM
Hmm....I don't get it. Some computers print the thing out just fine, while a few here at work will print 'em out all sloppy-like...
Well, anyway...You seem to be a smart guy, so Riddle me this, Royman...
If I have a form that needs to be sent to various people depending on the choice made in a dropdown menu, how would I do that? To find the page that I mean, go Forms>Potential Tenants>Residential. See the pull down menu towords the bottom of the page? I want the selections "The Broadmoor" and "Eagle Ridge" to send the form to clay@webpropertiesinc.com (when submit is clicked, not the pulldown menu selection itself), and I want the rest to be sent to rick@webpropertiesinc.com
Thanks again for all your awesome help!
-Ben
ReadMe.txt
07-11-2003, 08:09 PM
use the onchange event for the select box to change the value of the action for the form.
Ben@WEBProp
07-11-2003, 09:14 PM
Sorry, but I am unfamiliar with that command. Could you provide an example of how to do that with this code for my drop-down menu?
<td width="64%"><select size="1" name="Building_Name">
<option selected>The Cox Building</option>
<option>East 811</option>
<option>Gateway 1</option>
<option>Gateway 2</option>
<option>Park West</option>
<option>Redwood Plaza</option>
<option>Schade</option>
<option>The Taylor Building</option>
</select></td>
Where would I insert the onchange command? If it isn't in this line of code, lemme know what part of my source code that you need and I'll give you a link.
-Ben
ReadMe.txt
07-13-2003, 11:25 AM
Use this:
<td width="64%"><select size="1" name="Building_Name" onchange="document.FORMNAME.action=this.value">
<option selected value="mailto:rick@webproperties.com">The Cox Building</option>
<option value="mailto:clay@webproperties.com">East 811</option>
<option>Gateway 1</option>
<option>Gateway 2</option>
<option>Park West</option>
<option>Redwood Plaza</option>
<option>Schade</option>
<option>The Taylor Building</option>
</select></td>
you need to make sure each option has the correct email target by using the value field.
Ben@WEBProp
07-14-2003, 05:01 PM
Well, that didn't quite work...
I think I know why, but first I will tell you what is happening:
All the value="mailto:rick@webpropertiesinc.com part is doing is renaming the Building_Name to matilto:rick@...
So when the property manager recieves the e-mail, he sees
First Name=Bob
Last Name=TheBlob
...
...
mailto:rick@webpropertiesinc.com=The Broadmoor
What I think is going wrong is the fact that I am using FrontPage to set up this form...So I think there is a conflict or an overide on your strategy by these lines of code somewhere:
<form method="POST" action="--WEBBOT-SELF--" onSubmit="return FrontPage_Form1_Validator(this)" name="FrontPage_Form1">
<!--webbot bot="SaveResults" startspan U-File="../_private/form_results.txt"
S-Format="TEXT/CSV" S-Label-Fields="TRUE" B-Reverse-Chronology="FALSE"
S-Email-Format="TEXT/PRE" S-Email-Address="clay@webpropertiesinc.com"
B-Email-Label-Fields="TRUE" B-Email-Subject-From-Field="FALSE"
S-Email-Subject="RESIDENTIAL FORM REPLY" S-Builtin-Fields
U-Confirmation-Url="formYay.htm" U-Validation-Error-Url="Form_Error.htm" --><strong>[FrontPage Save Results Component]</strong><!--webbot
bot="SaveResults" endspan -->
Any Ideas on how to fix this problem without just deleting my web bots and adding in your code? Is there any way to alter my webbots or at leat anything in this line of coding to enable muli-sending?
-Ben
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.