Skip to main content
Known Participant
October 21, 2009
Answered

Baby steps - combining Javascript and HTML in RH7

  • October 21, 2009
  • 2 replies
  • 968 views

Help, please!

I know nothing about HTML programming, and I have several small links I would like to use with Javascript code.

This is one link for the user to click on:

<p style="font-size: 8pt; text-align: center;" align=center>Print this
page</td>

I have this little piece of Javascript:

<a href="javascript:window.print()">Print this page</a>

How do I put the two together?

I don't have time to learn HTML - I need to get this working by tomorrow!

Thanks for any help...

This topic has been closed for replies.
Correct answer RoboWizard

Hi there

Interesting that you say you don't know anything about HTML or JavaScript, then post the HTML code and the JavaScript code!

I suppose if you want to do it the HTML way, the new code would look something like this:

<p style="font-size: 8pt; text-align: center;" align=center><a href="javascript:window.print()">Print this page</a></td>

However, you should be able to just select the text in the WYSIWYG or Design view and act as if you are linking to another topic. In the Hyperlink dialog you would type javascript:window.print();

Hopefully this was helpful... Rick

Helpful and Handy Links

RoboHelp Wish Form/Bug Reporting Form

Begin learning RoboHelp HTML 7 or 8 within the day - $24.95!

Adobe Certified RoboHelp HTML Training

SorcerStone Blog

RoboHelp eBooks

2 replies

Known Participant
October 21, 2009

I'm confused again.

We found some Javascript code that does what we need in another area - buttons to print the current page, and open a window of a specific size, with no scrollbars, etc.

However, when we tried to add that code, RH kept rewriting it, putting in quotes, etc., then rejecting it for having errors.

I found the insert script option, which doesn't rewrite the code, but now can't figure out (or find out online - I looked, really!) how to associate that script with a link the user can click on.  All I get is the little red box.

Can anyone help?  Please?

RoboWizard
RoboWizardCorrect answer
Inspiring
October 21, 2009

Hi there

Interesting that you say you don't know anything about HTML or JavaScript, then post the HTML code and the JavaScript code!

I suppose if you want to do it the HTML way, the new code would look something like this:

<p style="font-size: 8pt; text-align: center;" align=center><a href="javascript:window.print()">Print this page</a></td>

However, you should be able to just select the text in the WYSIWYG or Design view and act as if you are linking to another topic. In the Hyperlink dialog you would type javascript:window.print();

Hopefully this was helpful... Rick

Helpful and Handy Links

RoboHelp Wish Form/Bug Reporting Form

Begin learning RoboHelp HTML 7 or 8 within the day - $24.95!

Adobe Certified RoboHelp HTML Training

SorcerStone Blog

RoboHelp eBooks

Known Participant
October 21, 2009

Very helpful, Rick, thank you!

I got the HTML code by going to the HTML view instead of the design view, and found the Javascript code on the Internet.

So, for another more complex one (also from the Internet), could I put it in a snippet and link to that in the hyperlink dialog?

Marion

Peter Grainge
Community Expert
Community Expert
October 21, 2009

Thanks, Colum, I'll look into that too.


You are wanting to create a simple link to a Snippet in a topic, correct? It can be done. See Item 4 in http://www.grainge.org/pages/authoring/rh7/using_rh7.htm


See www.grainge.org for RoboHelp and Authoring tips

Use the menu (bottom right) to mark the Best Answer or Highlight particularly useful replies. Found the answer elsewhere? Share it here.