By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,805 Members | 1,270 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,805 IT Pros & Developers. It's quick & easy.

Reference Active Page from Include

P: n/a
jp
Hi,

I have written a function that adds up numeric values from a multiple
textfields on a page and writes the sum to the total textfield. I would like
to move this from the page to an include so I can re-use on multiple pages.
How do i reference the active page in my script. This is an excerpt from the
function...

<script type="text/javascript">
function calctot(section)
{
if (section == "A")
{

/* Section A1 */

A = (document.frmSRData.A_BCI_RI_Public_Prod.value * 1) +
(document.frmSRData.A_BCI_RI_Public_Perf.value * 1);
document.frmSRData.A_BCI_RI_Public_SubTot.value = A;

B = (document.frmSRData.A_BCI_RI_Private_Prod.value * 1) +
(document.frmSRData.A_BCI_RI_Private_Perf.value * 1);
document.frmSRData.A_BCI_RI_Private_SubTot.value = B;
....

Do i need to pass a parameter to the function for the active page? Any help
with the syntax appreciated.

thanks,

jp
Jan 18 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
jp
Cheers - I find I am liking javascript more & more :)
"Lee" <RE**************@cox.net> wrote in message
news:dq*********@drn.newsguy.com...
jp said:

Hi,

I have written a function that adds up numeric values from a multiple
textfields on a page and writes the sum to the total textfield. I would
like
to move this from the page to an include so I can re-use on multiple
pages.
How do i reference the active page in my script.


When the script is included in a page, it becomes a part of the active
page.
All references to "document" refer to the active page.

Jan 19 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.