473,563 Members | 2,856 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Reference Active Page from Include

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.frmSR Data.A_BCI_RI_P ublic_Prod.valu e * 1) +
(document.frmSR Data.A_BCI_RI_P ublic_Perf.valu e * 1);
document.frmSRD ata.A_BCI_RI_Pu blic_SubTot.val ue = A;

B = (document.frmSR Data.A_BCI_RI_P rivate_Prod.val ue * 1) +
(document.frmSR Data.A_BCI_RI_P rivate_Perf.val ue * 1);
document.frmSRD ata.A_BCI_RI_Pr ivate_SubTot.va lue = 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
1 1150
jp
Cheers - I find I am liking javascript more & more :)
"Lee" <RE************ **@cox.net> wrote in message
news:dq******** *@drn.newsguy.c om...
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
12742
by: THE BIG MAN | last post by:
I am getting the errror Active Server Pages error 'ASP 0141' Page Command Repeated /contactform.asp, line 12 The @ command can only be used once within the Active Server Page. Anybody know why? <% Dim myMail, myBody
9
3704
by: Mario Rodriguez | last post by:
Hi people. I have a problem adding users to Win2003 active directory programatically. When I execute my app throws the following exception: .................The specified directory service attribute or value does not exist........... Exactly the same code works fine on my win2000 active directory. My app include the use of the...
3
7735
by: Amit | last post by:
Hi when I try to run LIST ACTIVE DATABASES AT DBPARTITIONNUM <partnum> or LIST ACTIVE DATABASES GLOBAL, I always get an error message. Does anyone know why? I'm on v8 fp 5 output : db2 => list active databases at dbpartitionnum 1; SQL0104N An unexpected token "1" was found following "<identifier>". Expected tokens may include: "GLOBAL". ...
1
3168
by: Jason Dunbar | last post by:
Whilst creating a class to search Active Directory domains and retrieve user details, I ran into the following error:- Object reference not set to an instance of an object. Here's the error log: Source Error:
1
4739
by: Andrew | last post by:
Hey all, Working on revamping our Intranet here and making use of the LDPA, Active Directory, Directory Services, etc. that .Net provides. I am still fairly new on this subject, so the problem I have run into I am not sure how to fix, and really not sure what is causing it. Here's what is going on (test server - Windows 2003 Server): I...
9
2165
by: Moe Sizlak | last post by:
Hi There, I am trying to write the selected value of a listcontrol when a button is clicked and I keep getting the error "object not set to a reference of an object". The libox itself is in a usercontrol and all i'm really needing to do is get the selected value when the button is clicked on the form. Can someone tell what I need to...
2
500
by: Ben | last post by:
I have several pages written in aspx, but sometime the aspx page return the following error. And it hapeen, the whole web application gives this error, that means all the aspx files get affected. Any ideas? Here is the error: Server Error in '/' Application. -------------------------------------------------------------------------------- ...
7
1891
by: Steve Bugden | last post by:
Hi, I am trying to reference an html page from an aspx file. The intention is that the html file will contain the content for my web site and the aspx will contain the navigation, logo etc. Then I am hoping I can maintain the html files separately via Frontpage. I have tried a server include i.e. <!-- #Include...
3
455
by: nemo | last post by:
Hi, My application works fine on the localhost but spits this error as soon as I put it on the server. I know this error occurs when an object has not been instantiated prior to a reference, but why shouldn't it happen in the localhost? Here's what the the whole error msg looks like:
0
7665
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7583
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2082
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1200
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.