I'm trying to make a form calculate a total as items are selected from a mix of radio/dropdown/chekcbox and display the total at the bottom and have the ability to submit the form.
This is what I have: http://jsfiddle.net/XD8RW/1430/ The total wont show up in the middle section when you click the different options
` Pricing
<div class="container">
<div class="column-left">
<p><b><u>Small ornaments (2 5/8")</u></b>
<br>Basic figure - $6.50
<br>(crane, pig, ball, flower etc.)
<br>Complex figure- $7.50
<br>(Dragon, skateboard, turkey etc.)
<br>Foil figures - $8.50
<br>(Anything made with foil paper)
<br>Money Figure - $8.50
<br>(Figures Made out of a $1 bill)
<br>
<br> <b><u>Large ornaments (4")</u></b>
<br>Basic figure - $8
<br>(crane, pig, ball, flower etc.)
<br>Complex figure- $9
<br>(Dragon, skateboard, turkey etc.)
<br>Foil figures - $10
<br>(Anything made with foil paper)
<br>Money Figure - $10
<br>(Figures Made out of a $1 bill)
<br>
</p>
</div>
<div class="column-center">
<form action="" id="orderform" onsubmit="return false;">
<fieldset>
<legend>Make your ornament!</legend>
<label><u>Size Of the Ornament</u>
</label>
<br>
<input type="radio" name="selectedornament" value="small" onclick="calculateTotal()" />Small Ornament (2 5/8") - $6.50
<input type="radio" name="selectedornament" value="small" onclick="calculateTotal()" />Large Ornament (4") - $8.50
<br>
<label>Figure</label>
<select id="figure" name='figure' onchange="calculateTotal()">
<option value="None">Select Figure</option>
<option value="Crane">Crane ($0.50)</option>
<option value="Pig">Pig ($0.50)</option>
<option value="Baseball">Baseball ($0.50)</option>
<option value="Basketball">Basketball ($0.50)</option>
<option value="Flower">Flower ($0.50)</option>
<option value="Dragon">Dragon ($1.50)</option>
<option value="Skateboard">Skateboard ($1.50)</option>
<option value="Turkey">Turkey ($1.50)</option>
<option value="Cherry">Dancing Girl ($3)</option>
<option value="Apricot">Dollar Pig ($1.50)</option>
<option value="Buttercream">Dollar Shirt ($1.50)</option>
<option value="Chocolate Mousse">Dollar Koi ($12)</option>
</select>
<br/>
<p>
<label for='foil' class="inlinelabel">Figure made of foil paper - ($1)</label>
<input type="checkbox" id="foil" name='foil' onclick="calculateTotal()" />
<br>(Except for designs made of one dollar bill)</p>
<p>
<label class="inlinelabel" for='includeinscription'>Include Custom Glass Etching ($6)</label>
<input type="checkbox" id="includeinscription" name="includeinscription" onclick="calculateTotal()" />
<input type="text" id="theinscription" name="theinscription" value="Enter Inscription" />
</p>
<div id="totalPrice"></div>
<input type='submit' id='submit' value='Submit' onclick="calculateTotal()" />
</fieldset>
</form>
</div>
<div class="column-right">
<p align="center"><b><u>*NOTE*</u></b>
</center>
<p>
<br>I generally don't charge extra for exterior paint unless you want something very detail-oriented or a design that would consume a large ammount of my paint/require me to buy additional paint colors (I only have red white and green paints for the holidays)
<br>Some figures are size/paper specific
<br>Money figures are limiited as to what can/can't be made, as are foiled figures as the foiled paper is sometimes difficult to work with
<br>When you contact me to place an order, I'll send you an e-mail back with pricing information specifically for your order</p>
</div>
the js is in the jsfiddle form sorry if i posted this wrong im new to stack overflow
like che-azeh said, there are some variables that are don't match up. You want to user the array of selectedornaments (theForm.elements["selectedornament"]). Here named selectedCake (you might want to change that). And size_prices should be the array you have defined as ornament_prices. Works on http://jsfiddle.net/XD8RW/1432/
Though you will want to double check the values your ornament_prices array