473,320 Members | 2,006 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Pass text to popup window

I would like to pass text to a popup window to save creating a new
html file for each help topic.
I would like to have a value for the heading, a value for the text,
code for printing the help page, and code to close the window.

------------------------------------------
the help window code is following

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function printWindow() {
bV = parseInt(navigator.appVersion);
if (bV >= 4) window.print();
}
// End -->
</script>

</head>
<body>
<h1 align="center">How to View Results</h1>

<ol>
<li>Locate the Application
<li>Leave your mouse over the application and the
popup window displayed
<li>Press the Page Down button on your keyboard
</ol>

<br><br>
<table width="100%"><tr><td>
<a href="javascript:printWindow()">
Print This Help Page</a>
</td><td align="right">
<a href="javascript:onclick=window.close()">
Close This Help Page</a>
</td></tr></table>
------------------------------------------------
Currently I use the following code for a popup.

<script language="JavaScript">
function popup(theURL){
window.open(theURL,"pop","height=300,width=300")
}
</script>
<a href="bfmenu.html" value="tip_print.html"
onClick="popup(this.value)">Print</a>...

<a href="bfmenu.html" value="tip_view.html"
onClick="popup(this.value)">View entire results</a>...

Jul 20 '05 #1
3 2878
In article <8c******************************@news.teranews.co m>,
tr*****@netfront.net enlightened us with...
I would like to pass text to a popup window to save creating a new
html file for each help topic.
I would like to have a value for the heading, a value for the text,
code for printing the help page, and code to close the window.


Want mine?

It uses a javascript array for help menu values and the call tells which
menu to open.
The window is reused if open. The window document is written dynamically
with the text value in the array.

You can add simple code to close it (or print it) with a link. My users
know how to click on the 'x'. :)

--
--
~kaeli~
You feel stuck with your debt if you can't budge it.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #2
I would love it. If you would prefer to E-Mail it to me (remove
nospam)
bf***@nospamsofthome.net
"kaeli" <ti******@NOSPAM.comcast.net> wrote in message
news:MP************************@nntp.lucent.com...
In article <8c******************************@news.teranews.co m>,
tr*****@netfront.net enlightened us with...
I would like to pass text to a popup window to save creating a new
html file for each help topic.
I would like to have a value for the heading, a value for the text, code for printing the help page, and code to close the window.

Want mine?

It uses a javascript array for help menu values and the call tells

which menu to open.
The window is reused if open. The window document is written dynamically with the text value in the array.

You can add simple code to close it (or print it) with a link. My users know how to click on the 'x'. :)

--
--
~kaeli~
You feel stuck with your debt if you can't budge it.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #3
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

Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: William Starr Moake | last post by:
The browser-based WYSIWYG editor I'm developing has a popup window with a form that generates table code from user input (width, border, cols, rows, bgcolor.) But the user has to copy-paste the...
1
by: TErnst | last post by:
Hello All.... What I am attempting to do is have a link/button on a page (testpopup.cfm) that opens a popup page (popupwindow.cfm). The popup page displays a resultset from a query and the...
2
by: umashd | last post by:
Hi, I am doing a web based project for my graduation. I studied bit of java for backend processesing and javascript for the client. Here is the scenario. In the FORM, I use INPUT TYPE=text...
4
by: dyw55a | last post by:
I have 2 webform in vb.NET application. On Webform1, I have one text box1 and one button. on Webform2, I have one text box . I need transfer the value of textbox 1 in webform1 to textbox2 in...
1
by: kebabkongen | last post by:
Hi, I am working on an application where I make a popup window with a long list of users (with checkboxes) I am trying to figure out how to pass the list of selected users to the parent window....
6
by: Ellie | last post by:
In my program the user clicks on a link and using the window.open function, opens a new window. I pass a url to the new window like this: <a href="#"...
1
by: praveenit | last post by:
hi, I am writing a small java script code where , when the textbox is clicked a pop up window is opened . on entering some data in the text area present in pop up window and pressing ''save"...
1
by: colleen1980 | last post by:
Hi: Can any one please tell me that how to i pass the two textbox values in the new page. If i use the form action in the popup window page then the new page is open in the same popup window as i...
18
by: vjayis | last post by:
hi i am having a form which contains an text field., when the submit button is clicked the value of the textfield should be taken into the new popup window to display the results. i had...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.