473,626 Members | 3,285 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Count total value from scrolldown menus.

Hi, I've got a little problem:

I'm trying to make a webpage with a few scrolldown menu's and I want
to count the values of them. In the scrolldown menu's are no numeric
values but the have to represent one. I hope I can explain it a little
bit better:

Scrolldownmenu 1:
- Option A (name A) --> (this has to represent te value 10 for
example)
- Option B (name B) --> (this has to represent te value 32 for
example)

Scrolldownmenu 2:
- Option A (name A) --> (this has to represent te value 15 for
example)
- Option B (name B) --> (this has to represent te value 30 for
example)

etc.. (a few other ones)

So I wanna count the values they represent to a total and put it in a
textfield. And if you select a name that i will add that value to the
total or update it (whitout refreshing the page).

And is it then also possible to give an error message if the total
value is above a specified value?

I think it is possible with javascript but I'm not that experienced.

Hopefully I explained it good enough and someone can help me.
thanks.
Jul 20 '05 #1
4 3013
Maybe you just want to use a free script that is easy to implement and
tested:

http://www.burmees.nl/menu/menus.htm

Wouter

"ZyPhiX" <mk@zyphix.co m> wrote in message
news:27******** *************** ***@posting.goo gle.com...
: Hi, I've got a little problem:
:
: I'm trying to make a webpage with a few scrolldown menu's and I want
: to count the values of them. In the scrolldown menu's are no numeric
: values but the have to represent one. I hope I can explain it a little
: bit better:
:
: Scrolldownmenu 1:
: - Option A (name A) --> (this has to represent te value 10 for
: example)
: - Option B (name B) --> (this has to represent te value 32 for
: example)
:
: Scrolldownmenu 2:
: - Option A (name A) --> (this has to represent te value 15 for
: example)
: - Option B (name B) --> (this has to represent te value 30 for
: example)
:
: etc.. (a few other ones)
:
:
:
: So I wanna count the values they represent to a total and put it in a
: textfield. And if you select a name that i will add that value to the
: total or update it (whitout refreshing the page).
:
: And is it then also possible to give an error message if the total
: value is above a specified value?
:
: I think it is possible with javascript but I'm not that experienced.
:
: Hopefully I explained it good enough and someone can help me.
:
:
: thanks.
Jul 20 '05 #2
That's not exactly what I'm looking for. I mean something like on this
page:

Maybe "listbox" is a better word?
www.verstappen.nl/NL/item12/2003.html
And then I want to add a value to each option. So I can make a total
sum of the selected values.

Hope it's clear now?
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #3
@SM
ZyPhiX a ecrit :

I'm trying to make a webpage with a few scrolldown menu's and I want
to count the values of them. In the scrolldown menu's are no numeric
values but the have to represent one. I hope I can explain it a little
bit better:


to add the value of row (1st row, 2nd, 3rd etc) in field "MyTotal"
and
to add the values of options in field "BigTotal"

<html>
<script type="text/javascript"><!--
function getRowNumber(My Menu,Field1,Fie ld2) {
if(document.all ) {
r = document.Field1 ;
c = document.Field2 ;
t = document.all['MyTotal'];
tt = document.all['BigTotal'];
}
else
if(document.get ElementsByName) {
r = document.getEle mentsByName(Fie ld1)[0];
c = document.getEle mentsByName(Fie ld2)[0];
t = document.getEle mentsByName('My Total')[0];
tt = document.getEle mentsByName('Bi gTotal')[0];
}
else {
r = document.forms['MyForm'].elements[Field1];
c = document.forms['MyForm'].elements[Field2];
t = document.forms['MyForm'].elements['MyTotal'];
tt = document.forms['MyForm'].elements['BigTotal'];
}
r.value = MyMenu.options. selectedIndex+1 *1;
t.value = t.value*1+r.val ue*1;
c.value = MyMenu.options[MyMenu.options. selectedIndex].value;
tt.value = tt.value*1+c.va lue*1;
if(tt.value>150 ) alert('That\'s too much !');
}

// --></script>

<form name="MyForm">
<p><select name="Scrolldow nmenu_1"
onchange="if(th is.options.sele ctedIndex>0)
getRowNumber(th is,'showR_1','s howV_1');">
<option>Choic e 1
<option value="5">A
<option value="3">B
</select>
<br>choosen Row 1 :<input type=text name="showR_1">
<br>choosen Value 1 :<input type=text name="showV_1">
<p><select name="Scrolldow nmenu_2"
onchange="if(th is.options.sele ctedIndex>0)
getRowNumber(th is,'showR_2','s howV_2');">
<option>Choic e 2
<option value="15">A
<option value="31">B
</select>
<br>choosen Row 2 :<input type=text name="showR_2">
<br>choosen Value 2 :<input type=text name="showV_2">
<p>Total rows : <input type=text name="MyTotal">
Total values : <input type=text name="BigTotal" >
</form>
</html>

--
******** (enlever/remove [OTER_MOI] du/from reply url) *******
Stéphane MORIAUX : mailto:st****** *************** @wanadoo.fr
Aide aux Pages Perso (images & couleurs, formulaire, CHP, JS)
http://perso.wanadoo.fr/stephane.moriaux/internet/
*************** *************** *************** *************** **
Jul 20 '05 #4
Oke thanks a lot. I'm going to try it.
thx.
"@SM" <st************ *********@wanad oo.fr> wrote in message news:<40******* ********@wanado o.fr>...

Answer

Jul 20 '05 #5

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

Similar topics

5
2948
by: Yellowbird | last post by:
Hi all, I'm new to JavaScript, but am pretty sure what I want to accomplish is not that difficult. I just need an example or suggestion to help clarify it for me - I haven't had much time to learn JS, so I have been using some prebuilt scripts where needed. I have a Web page form where a user can enter data. The first step is for them to select a dropdown menu to indicate the number of entries they will be making (the dropdown menu...
0
2245
by: Darren | last post by:
I have a report with one level of grouping and a running sum field in the detail section of the report. When I make the running sum field visible, I can see that it increases the count by 1 for each record in the group, just as it is supposed to do. However, when I place a field on the page footer to display the total count for the group, the value displayed is "0" unless the page has a full 26 lines of data, in which case the value...
1
6465
by: Irfan | last post by:
Hello, I am having some problem with count function. I have a report in which has grouping by a person wise and sub grouping in invoied status e.g.. the output will be Irfan Records (First Grouping by Person Wise) Total Number of Records = 30 (I am using count("*") funtion to get this and
3
4581
by: jason | last post by:
Hello. I've got this simple collection populate code I downloaded from the net (sorry can't find source now) I'm trying to test, but I can't seem to get it to work. Any help would be greatly appreciated. I've compiled the following VB.NET into a DLL: Imports System Imports System.Data Imports System.Data.SqlClient Imports System.Collections
10
3725
by: Zak McGregor | last post by:
Hi all is it possible to get a count(1) statemment, for example here: select count(1) from results where fixture=4916 and winner=away group by winner; to return a 0 value instead of absolutely nothing if no rows match fixture=4916 and winner=away? I get absolutely no results at all.
2
6995
by: kumar mcmillan | last post by:
hi. I am using a pseudo "pivot table" SQL query to generate a report but I am totally stumped on why the COUNT() function isn't getting me the expected results and was wondering if anyone has some ideas... it is for a statistical report showing which lead source a member followed when creating a profile (i.e. CNN ad, Chicago Tribune ad, etc), grouped by age range. here is the SQL that should total up rows based each specific
2
1465
by: wlaver | last post by:
I would like to sum up several numbers using xsl. I have tried <xsl:value-of select="count(//TotalScenarios)" /but that only returns the number of times that the tag "TotalScenarios" appears, and does not sum the actual value contained in the tag. Here is my xml. <ScenarioSummary> <LastRunDate>Aug 29, 2006 3:56:44 PM</LastRunDate> <Scenario>
22
12459
by: MP | last post by:
vb6,ado,mdb,win2k i pass the sql string to the .Execute method on the open connection to Table_Name(const) db table fwiw (the connection opened via class wrapper:) msConnString = "Data Source=" & msDbFilename moConn.Properties("Persist Security Info") = False moConn.ConnectionString = msConnString moConn.CursorLocation = adUseClient moConn.Mode = adModeReadWrite' or using default...same result
14
3639
by: zufie | last post by:
I have to create a QA report regarding callers calling into a phone hotline. The report consists of many checkboxes such as: Did the IBCCP agency contact you? Yes/NO How many days passed before you heard from the agency? 1Week/2Weeks/3 or More Weeks Did you become an IBCCP client? Yes/NO/Dont Know
0
8701
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8637
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8364
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8502
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7192
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6122
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4196
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2623
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
1807
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.