how to change the value of a field based on a quantity field and a select box
<p>I'm trying to update the value of a field based on a select box select option and the quantity of few quantity fields, it works fine for the first field but it wouldn't work for the rest.</p>

<p>this is the link to the site is <a href="http://www.snappy-pizza.net/pizza1c.php" rel="nofollow">http://www.snappy-pizza.net/pizza1c.php</a></p>

<p>if you choose a pizza for the first time and add toppings to it, the value of the updated price field will increase as expected, now if you change your pizza with the same toppings only the first topping will be added to the price and not the other ones.</p>

<pre><code>  &lt;input name="update_price" type="text" id="update_price" value="" size="8" maxlength="8" /&gt;


  &lt;form&gt;
                &lt;select name="select" id="select"&gt;
                  &lt;option&gt;Select your pizza&lt;/option&gt;
                  &lt;option value="6.65"&gt;NY, 10&amp;quot;, £6.65&lt;/option&gt;
                  &lt;option value="8.95"&gt;NY, 12&amp;quot;, £8.95&lt;/option&gt;
                  &lt;option value="11.95"&gt;NY, 16&amp;quot;, £11.95&lt;/option&gt;
                  &lt;option value="3.45"&gt;Chicago, 7&amp;quot;, £3.45&lt;/option&gt;
                  &lt;option value="6.65"&gt;Chicago, 10&amp;quot;, £6.65&lt;/option&gt;
                  &lt;option value="8.95"&gt;Chicago, 12&amp;quot;, £8.95&lt;/option&gt;
                  &lt;option value="11.95"&gt;Chicago, 16&amp;quot;, £11.95&lt;/option&gt;
                  &lt;option value="19.95"&gt;Chicago, Beast 24&amp;quot; x 18&amp;quot;, £19.95&lt;/option&gt;
                 &lt;/select&gt;
         &lt;/form&gt;


       &lt;form&gt;
         &lt;tr&gt;
            &lt;td&gt; 

            &lt;span class="descriptionsPizza"&gt;EXTRA CHEESE&lt;/span&gt;
            &lt;input name="minus1" type="button" class="button minus" id="minus1" value=" - " /&gt;
            &lt;input name="textfield1" type="text" id="textfield1" class="valfield" size="2" maxlength="2" value="0" /&gt;
            &lt;input name="add1" type="button" class="button add" id="add1" value=" + " /&gt;
            &lt;/td&gt;

            &lt;td&gt;
            &lt;span class="descriptionsPizza"&gt;HAM&lt;/span&gt;    
            &lt;input name="minus2" type="button" class="button minus" id="minus2" value=" - " /&gt;
            &lt;input class="valfield" name="textfield2" type="text" id="textfield2" size="2" maxlength="2" value="0"/&gt;
            &lt;input name="add2" type="button" class="button add" id="add2" value=" + " /&gt;
            &lt;/td&gt;
         &lt;/tr&gt;




           //function to change the quantity field by pressing the + and - buttons
   $(function()
    {
      topping_price = 1;
      $(".add").click(function(){
     var newQty =+($(this).siblings(".valfield").val()) + 1;
     $(this).siblings(".valfield").val(newQty);

 current_price =+($('input[name=update_price]').val() );
 $('input[name=update_price]').val(topping_price + current_price);
  });

 $(".minus").click(function(){
 var newQty = +($(this).siblings(".valfield").val()) - 1;
 if(newQty &lt; 0)newQty = 0;
 $(this).siblings(".valfield").val(newQty);

var current_price =+($('input[name=update_price]').val() );
$('input[name=update_price]').val(current_price - topping_price);
});
</code></pre>

<p>});</p>

<pre><code>  //function to get the value and text of the selected select box and insert them into hidden fields.
 $(function()
  {
$('#select').change( function() {
 $('input[name=my-item-name]').val( $("#select :selected").text() );
 $('input[name=my-item-price]').val( $("#select").val() );

 $(".add").each(function() {
  //gets the value of the selected box (i.e.price) and insert it into the updated price field.
  var new_qty =+ ($(".add").siblings(".valfield").val() );
  var pizza_price =+ ($("#select :selected").val() );
  $('input[name=update_price]').val((new_qty * topping_price) + pizza_price);
 });
});
</code></pre>

<p>});</p>

<p>any help would be appreciated..</p>
