adding up checkbox values

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Oct 2006
Posts: 10
Reputation: mike7510uk is an unknown quantity at this point 
Solved Threads: 0
mike7510uk mike7510uk is offline Offline
Newbie Poster

adding up checkbox values

 
0
  #1
Oct 23rd, 2006
i have a form that has several checkboxes. I want a label to display the total amount of all the checkboxes clicked.
for example:
cbo1 = 100
cbo 2 = 75

if the user clicks both then the label will display 175
also, if the user unclick a box it will deduct it from the total.
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 483
Reputation: campkev is an unknown quantity at this point 
Solved Threads: 19
campkev campkev is offline Offline
Posting Pro in Training

Re: adding up checkbox values

 
0
  #2
Oct 24th, 2006
do you want the changes to take place immediately? or after form is submitted?
Reply With Quote Quick reply to this message  
Join Date: Nov 2005
Posts: 95
Reputation: ManicCW is an unknown quantity at this point 
Solved Threads: 11
ManicCW's Avatar
ManicCW ManicCW is offline Offline
Junior Poster in Training

Re: adding up checkbox values

 
0
  #3
Oct 25th, 2006
  1. Dim myResult as Integer = 0
  2. For Each chk as CheckBox in myPanel.Controls
  3. If chk.Checked = True Then
  4. myResult += chk.Value
  5. End If
  6. Next
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC