In article <2a******************************@news.teranews.co m>,
tr*****@netfront.net enlightened us with...
I would love it. If you would prefer to E-Mail it to me (remove
nospam)
bf***@nospamsofthome.net
It's not all that big (well, I took out all but two of my help screens
for the sake of example; the real file is quite long with a help screen
for every form field). Watch for word wrap.
Note: tested in IE5+/NN4+/Moz1.2 only. Some functions may not work in
other browsers. This is used for an intranet app where I know my users,
so if you don't, add error checking and fallback. However, I'm not doing
anything fancy, and I use the evil javascript
: in a link so it works in
NN4 (no onClick of image in NN4).
File 1: jsHelp.js: put help descriptions in here like you see with the
basic "help" and "h_qty". Note that all my "Screens" except "help" begin
with "h_" to keep var names unique, as many js files are included in the
site.
-----------------------
/*jsHelp.js
Has help functions
var h_window = null;
var h_array = new Array();
/* descriptions that remain constant */
h_array["help"] = "<p>Click on any of the help icons to bring up a
javascript window "+
"with relevant information.</p>";
h_array["h_qty"] = "<h1>Quantity</h1>" +
"<p>Description: the number of this item in this
order. Left blank, the quantity will be 1.</p> ";
// put more below this
/* functions that get called when user presses a help button */
function openHelp(screenName)
{
if (!h_window || h_window == null || typeof h_window == "undefined" ||
h_window.closed || !h_window.document)
h_window = window.open("","Help","height=200,width=
200,scrollbars=yes,resizable=yes");
var doc = h_window.document;
doc.open();
doc.writeln("<html><head><title>Help</title>");
doc.writeln("<link rel='stylesheet' type='text/css'
href='myStylesheet.css'>");
doc.writeln("</head><body>");
doc.writeln(h_array[screenName]);
// add close and / or print links/buttons here
doc.writeln("</body></html>");
doc.close();
h_window.focus();
return;
}
/* end jsHelp.js */
----------------------------
in the html file, in the head
<script language="javascript" type="text/javascript"
src="jsHelpFunctions.js"></script>
in the body...
I use a help icon for the users to click on. Modify as appropriate.
<a href="javascript
:openHelp('help)"><img src="help.gif" width="15"
height="15" border="0"></a>
If using new browsers only, change to onClick of image, which is better.
Old NN doesn't support that and not sure on Opera support.
To make a close button or link, use self.close().
To mail, use self.print() (I think).
You would add that to what gets printed in the window by adding it in
the help file where I put that comment in.
HTH
--
--
~kaeli~
Once you've seen one shopping center, you've seen a mall.
http://www.ipwebdesign.net/wildAtHeart http://www.ipwebdesign.net/kaelisSpace