Question : Need some urgent help with adding totals on a page

I have to get a php form for an event registration finished ASAP and one of the last headaches I have (besides getting all this to PayPal - but that's another question) is to get the fields that deal with money to give me a grand total.  The wrinkle is that the form consists of 4 different options - and each option has different fields with different pricing.  

The form starts with 4 radio buttons (code courtesy of mplungian) for the different event options - buy tickets, sponsor a table, become a sponsor or make a donation.  Depending on which is selected, different fields are displayed - select the buy ticket option and the list of tickets will appear but no the sponsor fields and so on.  The only group that is always open, no matter what event option is selected is the 5 boxes for honoraria.

The fields are below in the code box with their respective areas.  The numbers only function is for restricting the input.

How can I get a running total of all these? I need these to total whether they are visible on the page or not.  Then I'll post that total to the database and pass it to my PayPal button so they can pay.

I've found a good script for the text boxes using onkeypress, but the textbox id's had to be named the same. I can't change mine so I'm pretty stuck at the moment and could use some help.

Thanks in advance.

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
<!-- Tickets -->
<select id="tktTickets" name="tktTickets" onchange="getValue(this);">
<option value="">- Select the number of tickets you wish to order -----</option>
<option value="100">1 ticket - $100.00</option>
<option value="200">2 tickets - $200.00</option>
<option value="300">3 tickets - $300.00</option>
<option value="400">4 tickets - $400.00</option>
<option value="500">5 tickets - $500.00</option>
<option value="600">6 tickets - $600.00</option>
<option value="700">7 tickets - $700.00</option>
<option value="800">8 tickets - $800.00</option>
<option value="900">9 tickets - $900.00</option>
<option value="1000">10 tickets - $1000.00</option>
</select>

<!-- Sponsor -->
<input id="sponsorLevel1" name="sponsorLevel" type="radio" value="25000" />Presenting Level ($25,000)
<input id="sponsorLevel2" name="sponsorLevel" type="radio" value="15000" />Supporting Level ($15,000)
<input id="sponsorLevel3" name="sponsorLevel" type="radio" value="10000" />Caring Level ($10,000)
<input id="sponsorLevel4" name="sponsorLevel" type="radio" value="5000" />Courage Level ($5,000)
<input id="sponsorLevel5" name="sponsorLevel" type="radio" value="2000" />Confidence Level ($2,500)

<!-- Donate -->
<input id="donateAmt" name="donateAmt" type="text" value="" />

<!-- Honoraria - Common to All -->
<input id="halliday" name="halliday" type="text" onkeypress="return onlyNumbers();" value="" />
<input id="miers" name="miers" type="text" onkeypress="return onlyNumbers()" value="" />
<input id="sykes" name="sykes" type="text" onkeypress="return onlyNumbers();" value="" />
<input id="avery" name="avery" type="text" onkeypress="return onlyNumbers();" value="" />
<input id="jonson" name="jonson" type="text" onkeypress="return onlyNumbers();" value="" />

function onlyNumbers() 
	{
	var e = event || evt; // for trans-browser compatibility
	var charCode = e.which || e.keyCode;
		if ( (charCode < 48 || charCode > 57) && charCode != 46 && charCode != 44 ) 
		return false;
	return true;
}

Answer : Need some urgent help with adding totals on a page

that's okay, basically i need you first to confirm if all fields are filled, you are getting the right numbers.

avoiding NaN is easier than building the whole script :)

see attached file with all your needs :)
 
updated file
 
Random Solutions  
 
programming4us programming4us