473,583 Members | 2,751 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 3009
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...
0
2242
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,...
1
6464
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...
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
6993
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,...
2
1463
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>...
22
12447
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...
14
3637
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
7896
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
8186
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. ...
0
8197
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...
0
6583
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...
1
5704
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
3821
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2335
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
1436
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1160
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.