• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Print Button on Drop-Down window

Community Beginner ,
Nov 26, 2008 Nov 26, 2008

Copy link to clipboard

Copied

Hello,

our internal customer wants to be able to print topics from a drop-down window.

This worked well with "RoboHelp for Word" and WinHelp output, but I fail to add the same functionality in a "Robohelp for HTML" (R 7) project with HTML Help (CHM) output. In fact the functionality seems to work (Topic is printed correctly), but in the window I immediately get a browser message that the content cannot be diplayed (topic disappears). The same is true for the "Copy" function (content is copied to windows clipboard but error message appears in the window). For the "Close" function the HTML help is minimized to the bottom tray. I added the following snippet

...
<table x-use-null-cells style="background-color: #808080; width: 100%; height: 50px; border-style: 0;"
height=50 width=100% bgcolor=#808080>
<tr><td><implicit_p>
<input type=submit name=button1 value=Print onClick="window.print();">
<input type=submit name=button3 value=Copy onClick="javascript:CopiedTxt = ocument.body.createTextRange();CopiedTxt.execCommand('Copy')">
<input type=submit name=button2 value=Close onClick="window.blur()">
</td></tr>
</table>
.....

What's wrong? Unfortunately I'm not fluent in Javascript :-(

Regards, Pinkepunk

Views

545

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Beginner , Nov 27, 2008 Nov 27, 2008
Hi Pete,

we finally found the error: the input type should be "button" instead of "submit". The correct code for our snippet with three buttons ("Print", "Copy", "Close") is now (see attached code below):

Cheers, Pinkepunk
-------------------------------------------------------------------------------------------------------------------

Votes

Translate

Translate
Community Expert ,
Nov 26, 2008 Nov 26, 2008

Copy link to clipboard

Copied

Maybe a simpler solution would be a single button on the toolbar that will print whichever topic is displayed without requiring any code in that topic.

See Snippet 24 on my site.

Help others by clicking Correct Answer if the question is answered. Found the answer elsewhere? Share it here. "Upvote" is for useful posts.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Nov 26, 2008 Nov 26, 2008

Copy link to clipboard

Copied

Hi, Pinkepunk,

I can't reproduce the print issue in my test .chm file (no browser message), so I assume that there is something else in the help topic that causes the problem to arise. Perhaps you can post the complete contents of a topic?

The error message that I see when using the Copy function is caused by the "ocument.body.createTextRange();" method, which should be changed to " d ocument.body.createTextRange();".

If you want to quit the help window when the Close button is clicked, you need to use an HTML Help Close Window control. See the example below.

Pete

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 26, 2008 Nov 26, 2008

Copy link to clipboard

Copied

Hi, Pete,

Thanks for answering.

> document.body.createTextRange();"
The 'd' got lost when I formatted the post the forum.

>onClick="hhctrl.Click()"
HHCTRL does not seem to be know object in my project.

The problem is not connected with the topic content. I created a test project from scratch with just two topics and the snippet in it: Same problem. The error page has the following address (right click):

res://C:\WINNT\system32\shdoclc.dll/dnserror.htm#mk:@MSITStore:C:\Apps\Test\Test%20Buttons\TestSnippets\!SSL!\Microsoft_HTML_Help\TestSnippets.chm::/DropDown.htm?button2=Schlie%DFen

It seems that the page name is confusing RoboHelp: Schlie%DFen refers to the German "Schließen" which includes a special character.

Regards, Pinkepunk

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Nov 26, 2008 Nov 26, 2008

Copy link to clipboard

Copied

Hi, again,

Can you zip up and send me your test project so that I can take a closer look at it?

Click my user name at the left to contact me.

Pete

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 27, 2008 Nov 27, 2008

Copy link to clipboard

Copied

LATEST
Hi Pete,

we finally found the error: the input type should be "button" instead of "submit". The correct code for our snippet with three buttons ("Print", "Copy", "Close") is now (see attached code below):

Cheers, Pinkepunk
-------------------------------------------------------------------------------------------------------------------

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
RoboHelp Documentation
Download Adobe RoboHelp