Javascript to add delivery fee based on certain price
<p>I have website where I am implementing a checkout solution.</p>

<p>The customer has 2 prices:</p>

<p>Installed price</p>

<p>and</p>

<p>Not Installed price</p>

<p>Both buttons have the same name "sub_amount".</p>

<p>I need a javascript that:</p>

<p>When the user clicks whichever price (button, installed or not installed) , the javascript needs to do two things :</p>

<ol>
<li>Calculate a sales tax of 6% (to be sent to final order page)</li>
<li>add a delivery cost of $10 unless the amount is over $50. (before tax price is added)</li>
</ol>

<p><strong>So, I have two objectives</strong> </p>

<ul>
<li>add a sales tax of 6%</li>
<li>on click (of installed or not installed button) add a delivery charge of $10 if over $50</li>
</ul>

<p>tax should be on initial price only (<strong>not</strong> price once the delivery is added)</p>

<p>I looked here and this is similar what I need, but I don't want the on window alert and I don't know the proper syntax for my specific need. </p>

<p><a href="http://stackoverflow.com/questions/4606296/in-javascript-doing-a-simple-shipping-and-handling-calculation">In JavaScript doing a simple shipping and handling calculation</a></p>

<p>Can anyone tell me the correct syntax for what I am trying to do?</p>
