473,322 Members | 1,352 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,322 software developers and data experts.

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 2998
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.com> wrote in message
news:27**************************@posting.google.c om...
: 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(MyMenu,Field1,Field2) {
if(document.all) {
r = document.Field1;
c = document.Field2;
t = document.all['MyTotal'];
tt = document.all['BigTotal'];
}
else
if(document.getElementsByName) {
r = document.getElementsByName(Field1)[0];
c = document.getElementsByName(Field2)[0];
t = document.getElementsByName('MyTotal')[0];
tt = document.getElementsByName('BigTotal')[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.value*1;
c.value = MyMenu.options[MyMenu.options.selectedIndex].value;
tt.value = tt.value*1+c.value*1;
if(tt.value>150) alert('That\'s too much !');
}

// --></script>

<form name="MyForm">
<p><select name="Scrolldownmenu_1"
onchange="if(this.options.selectedIndex>0)
getRowNumber(this,'showR_1','showV_1');">
<option>Choice 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="Scrolldownmenu_2"
onchange="if(this.options.selectedIndex>0)
getRowNumber(this,'showR_2','showV_2');">
<option>Choice 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*********************@wanadoo.fr> wrote in message news:<40***************@wanadoo.fr>...

Answer

Jul 20 '05 #5

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

Similar topics

5
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...
0
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...
1
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...
3
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...
10
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...
2
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...
2
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...
22
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="...
14
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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.