Y
Yonih
So I am trying to get this Calculator to work. It needs to take in a
vaule, and select a shipping
Everythin works great except the shipping part. I need it to take the
shipping value and add it to the "Downpayment" and also the "Total
amount paid"
Example: item cost $20.00 , $8.50 shipped selected,
Payment 1 = 12 + 8.50 so $20.50
Payments 2-5 = $2.00
Final Payment = $28.50
can Anyone help me?
<body>
<form name="converter">
<input type="text" value="0.00" name="price"> Price of Item
<br>
<select name="shippingOptions" onchange="this.form.shippingPrice.value
= this.options[this.selectedIndex].value; ">
<option value="8.50">Ground - $8.50</option>
<option value="10.50">3-Day - $10.50</option>
<option value="14.50">2-Day - $14.50</option>
<option value="24.00">Overnight - $24.00</option></select>
<input type="text" value="" name="shippingPrice">
<br>
<br><br>
<input type="button" value="Convert" onclick="javascript:calc()">
<input type="reset" value="reset" onclick="javascript:calc()">
<br><br>
<input type="text" value="" name="downpayment"> Down Payment
<br>
<input type="text" value="" name="payment2"> Payment 2
<br>
<input type="text" value="" name="payment3"> Payment 3
<br>
<input type="text" value="" name="payment4"> Payment 4
<br>
<input type="text" value="" name="payment5"> Payment 5
<br>
<br>
<input type="text" value="" name="total"> Total Amount Paid
</form>
<script language="javascript">
//calculate function
function calc(){
//variables
var price = document.converter.price.value
var downpaymentdisplay = Math.round(price * .60)
var payment2display = Math.round(price * .10)
var payment3display = Math.round(price * .10)
var payment4display = Math.round(price * .10)
var payment5display = Math.round(price * .10)
var totaldisplay = Math.round(downpaymentdisplay + payment2display +
payment3display + payment4display + payment5display)
//write in text box
document.converter.downpayment.value=downpaymentdisplay
document.converter.payment2.value=payment2display
document.converter.payment3.value=payment3display
document.converter.payment4.value=payment4display
document.converter.payment5.value=payment5display
document.converter.total.value=totaldisplay
}
</script>
</body>
Thanks
Yoni
vaule, and select a shipping
Everythin works great except the shipping part. I need it to take the
shipping value and add it to the "Downpayment" and also the "Total
amount paid"
Example: item cost $20.00 , $8.50 shipped selected,
Payment 1 = 12 + 8.50 so $20.50
Payments 2-5 = $2.00
Final Payment = $28.50
can Anyone help me?
<body>
<form name="converter">
<input type="text" value="0.00" name="price"> Price of Item
<br>
<select name="shippingOptions" onchange="this.form.shippingPrice.value
= this.options[this.selectedIndex].value; ">
<option value="8.50">Ground - $8.50</option>
<option value="10.50">3-Day - $10.50</option>
<option value="14.50">2-Day - $14.50</option>
<option value="24.00">Overnight - $24.00</option></select>
<input type="text" value="" name="shippingPrice">
<br>
<br><br>
<input type="button" value="Convert" onclick="javascript:calc()">
<input type="reset" value="reset" onclick="javascript:calc()">
<br><br>
<input type="text" value="" name="downpayment"> Down Payment
<br>
<input type="text" value="" name="payment2"> Payment 2
<br>
<input type="text" value="" name="payment3"> Payment 3
<br>
<input type="text" value="" name="payment4"> Payment 4
<br>
<input type="text" value="" name="payment5"> Payment 5
<br>
<br>
<input type="text" value="" name="total"> Total Amount Paid
</form>
<script language="javascript">
//calculate function
function calc(){
//variables
var price = document.converter.price.value
var downpaymentdisplay = Math.round(price * .60)
var payment2display = Math.round(price * .10)
var payment3display = Math.round(price * .10)
var payment4display = Math.round(price * .10)
var payment5display = Math.round(price * .10)
var totaldisplay = Math.round(downpaymentdisplay + payment2display +
payment3display + payment4display + payment5display)
//write in text box
document.converter.downpayment.value=downpaymentdisplay
document.converter.payment2.value=payment2display
document.converter.payment3.value=payment3display
document.converter.payment4.value=payment4display
document.converter.payment5.value=payment5display
document.converter.total.value=totaldisplay
}
</script>
</body>
Thanks
Yoni