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

I need help with checkboxes and calculating

15
Ok, I need help with putting values of checkboxes in the code,

Heres an example of how my form wil l look like:



Ok I wanted it so The Trivium checkbox would obv equal to £50, so if I checked it, it would be selected and the price would be displayed in total price, and for the part where it says number of adults I wanted to set it so each adults would cost £5+ticket, as an example, below it shud say number of child but I forgot to rename, anyway I really am stuck with the checkbox and how to put those values in.

It's a bit messy there so il try and explain better,


I guess for the first part I would like to find out how to put values in checkboxes and calculate that price, example would be

Trivium select > Current Price in total is £50 (£50 per adult), for 2 adults price would be £100, I guess the number of adults should be default 1,

Price per Child is £25


So If they selected 2 adults and 2 children the total price would be £150, if my maths is correct :)


Anyway my design is a lot bigger than that but if I can figure out how to do those few things then I should be able to do it by myself

Thanks anyway
Mar 19 '08 #1
5 1809
carl2k2
15
Ok I found out a few things, just stuck on one part

If CHKtriv.Value = 1 Then
LBLtotal.Caption = "£50"
Else
LBLtotal.Caption = ""
End If

How to expand this, for it to check if the adults, I think the forumula needed it

£50 * Adult value = Adult Price, so it would be £50 * 4 = £200 for 4 adults, but I dont know what code I need for that.
Mar 19 '08 #2
lotus18
866 512MB
Ok I found out a few things, just stuck on one part

If CHKtriv.Value = 1 Then
LBLtotal.Caption = "£50"
Else
LBLtotal.Caption = ""
End If

How to expand this, for it to check if the adults, I think the forumula needed it

£50 * Adult value = Adult Price, so it would be £50 * 4 = £200 for 4 adults, but I dont know what code I need for that.
Add a command button, then try this
Expand|Select|Wrap|Line Numbers
  1. Private Sub Command1_Click()
  2.    lblTotal.Caption=50*Val(txtNoOfAdults.Text)
  3. End Sub
Just continue...
Mar 20 '08 #3
carl2k2
15
Ok Thanks, that small code has helped me a lot :D
Mar 20 '08 #4
carl2k2
15
How to add currency £ ?
Mar 20 '08 #5
QVeen72
1,445 Expert 1GB
Hi,

Check this :

Expand|Select|Wrap|Line Numbers
  1. lblTotal.Caption=Chr(163) & "  " & 50*Val(txtNoOfAdults.Text)
  2.  
Regards
Veena
Mar 21 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Geoff Lane | last post by:
Browser: IE5+ I have a form with an unknown number of checkboxes (the page is generated by a server-side script). I need to loop through those checkboxes, test whether the name of each checkbox...
2
by: Czarina | last post by:
hi guys! here I am again, bugging you Here is where my page stands right now: http://www.gainesvillewebs.com/czar...h_results-2.htm The top 2 forms are working just fine, but the bottom one, with...
2
by: Pat Scott | last post by:
I am looking for a general purpose javascript snippet that enables me to <div> or <span> HTML to make portions of the form be hidden and then appear. The form contains about 12 sections and some...
1
by: rdlauer | last post by:
I've just run into a strange problem with IE 6 and I'm wondering if anyone else has seen the same: On my form I have a hidden field that contains the HTML for a series of checkboxes: <input...
18
by: Ed Jay | last post by:
<disclaimer>js newbie</disclaimer> My page has a form comprised of several radio buttons. I want to poll the buttons to determine which button was selected and convert its value to a string. I...
2
by: clinttoris | last post by:
Hello, If someone could help me it would be appreciated as I am not having much luck. I'm struggling with my asp code and have some questions relating to asp and oracle database. First...
6
by: nasirmajor | last post by:
dear all, i have a datagrid with checkboxes for selection of rows. and want to get unique id/ids(job_code) from the selected rows in array etc. can anyone help. <asp:datagrid id="dgResults"...
2
by: S. Kitty | last post by:
Hi everyone! I have a bit of a weird problem right now with the addition of a record in a subform. The database is supposed to keep track of a list of projects for a consulting company. ...
6
blazedaces
by: blazedaces | last post by:
Hey, so here's an example of what I want to do: This "window" if you will, or simple gui, will accept an ArrayList<String> and in turn spit out for every one of them a checkbox and a text field...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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,...
0
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...

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.