...

View Full Version : Fix Payment form



wizard0522
02-16-2012, 09:52 PM
1) Project Details: (be as specific as possible):
I am looking for someone to please fix my form so that the quantity section will update the price correctly, and also if the quantity is more then 5 I would like the price to change to a specific price.

Here is my form:



<script type="text/javascript">

florida_tax_rate = .07;

function update_price(radio) {

price = parseFloat(radio.getAttribute("price"));
shipping = parseFloat(document.getElementById("shipping").innerHTML);

subtotal = document.getElementById("subtotal");
grand_total = document.getElementById("grand_total");

subtotal.innerHTML = price;
grand_total.innerHTML = (shipping + price).toFixed(2);

update_tax();

}

function update_tax() {

menu = document.getElementsByName("ShippingState")[0];

state = menu.value;
is_florida = state.match(/^(florida|fl)$/i);

price = parseFloat(document.getElementById("subtotal").innerHTML);
shipping = parseFloat(document.getElementById("shipping").innerHTML);

real_subtotal = price + shipping;
taxes = 0.00;

if (is_florida) {
taxes = real_subtotal * florida_tax_rate;
}

grand_total = document.getElementById("grand_total");

document.getElementById("taxes").innerHTML = taxes.toFixed(2);
grand_total.innerHTML = (real_subtotal + taxes).toFixed(2);

}

</script>

<form>
<input onchange="update_price(this);" type="radio" name="package" value="non-chamber" price="450.00" />
Non-Chamber Member (Qty: 0-5)<br />
<select name="Quantity">
<option value="Please Select" selected="selected">Please Select</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
</select>
<br />

<input onchange="update_price(this);" type="radio" name="package" value="chamber" price="425.00" />
Chamber Member (Qty: 0-5)<br />
<select name="Quantity">
<option value="Please Select" selected="selected">Please Select</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
</select>

<div style="display:none;"><select onchange="update_tax();" name="ShippingState">
<option value="Florida" selected="selected">Florida</option>
</select></div>



<br />

Subtotal: $<span id="subtotal">0.00</span><br />
<div style="display:none;">Shipping: $<span id="shipping">0.00</span><br /></div>
Taxes: $<span id="taxes">0.00</span><br />
Grand Total: $<span id="grand_total">0.00</span><br />
<br />

<img src="http://www.paypal.com/en_US/i/btn/btn_paynowCC_LG.gif" onClick="document.paypalPayment.submit();" />
<input type="hidden" name="process" id="process" value="1" />
</form>


2) Payment method/ details (Paypal, check? Timeline?):

I need this done in 2 hours and I will pay via paypal as soon as the job is done



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum