logic required in javascript
<p>i have a select option which works fine,but what i want is if more than one is selected then 10 % discount has to be added, how can this be done</p>

<p>and on selected the value multiplies in Java script</p>

<pre><code>//javascript

function totprice(f,n,amt)
                {

                    var tot=0;
                    document.getElementById('lbl_tot'+n).value=amt*f;

                    for (var k=1; k&lt;=document.getElementById('rowcnt').value; k++)
                    {

                            if(document.getElementById('lbl_tot'+k))
                            {
                                tot=parseInt(tot) + parseInt(document.getElementById('lbl_tot'+k).value);
                            }

                    }

                    document.getElementById('txttot').value=tot;

                    document.getElementById('txttotprice').value=tot;


                }
</code></pre>

<p>HTML</p>

<pre><code>&lt;select name="amt" id="amt" onchange="return totprice(this.value,2,110);"&gt;
  &lt;option value="0"&gt;0&lt;/option&gt;
  &lt;option value="1"&gt;1&lt;/option&gt;
  &lt;option value="2"&gt;2&lt;/option&gt;
  &lt;option value="3"&gt;3&lt;/option&gt;
  &lt;option value="4"&gt;4&lt;/option&gt;
  &lt;option value="5"&gt;5&lt;/option&gt;
  &lt;option value="6"&gt;6&lt;/option&gt;
  &lt;option value="7"&gt;7&lt;/option&gt;
  &lt;option value="8"&gt;8&lt;/option&gt;
  &lt;option value="9"&gt;9&lt;/option&gt;
  &lt;option value="10"&gt;10&lt;/option&gt;
  &lt;option value="11"&gt;11&lt;/option&gt;
  &lt;option value="12"&gt;12&lt;/option&gt;
  &lt;option value="13"&gt;13&lt;/option&gt;
  &lt;option value="14"&gt;14&lt;/option&gt;
  &lt;option value="15"&gt;15&lt;/option&gt;
  &lt;option value="16"&gt;16&lt;/option&gt;
  &lt;option value="17"&gt;17&lt;/option&gt;
  &lt;option value="18"&gt;18&lt;/option&gt;
  &lt;/select&gt;
</code></pre>
