javasscript temp variable
<p>Hi this is the situation </p>

<pre><code>var seat_sel = document.getElementById('cmb_num_seat').value;

var cashp = document.getElementById('hdn_price').value;

var CHILD_PRICE = '5'

if(seat_sel &gt; 0){
    CHILD_PRICE = CHILD_SEAT_PRICE * seat_selected;
}else{
        CHILD_PRICE = CHILD_SEAT_PRICE * seat_selected;
}   
   document.getElementById('disp_2_div').innerHTML = formatCurrency(parseInt(cashp)+parseInt(CHILD_PRICE));
   document.getElementById('hdn_price').value = formatCurrency(parseInt(cashp)+parseInt(CHILD_PRICE))
</code></pre>

<p>For example...</p>

<p>i have <code>cashp=20</code> ,</p>

<p>When user select the <code>cmb_num_seat(DROP DOWN)</code> , Then Price will be increase That is </p>

<pre><code>20+(5*3)=20+15=45
</code></pre>

<p>Assume i selected 3 in the dropdown...</p>

<p>But in some situation , Calculation goes wrong...</p>

<p>Like select 3 , and then select 4 and then select 2 and then selecting 1 , </p>

<p>In this situation old   value hdn_price is over riding ...bcoz of ADDITION ...</p>

<p>Is there any way ...maintain first value in some variable and then doing the calculation... </p>
