Ten en cuenta que hay interes simple y compuesto..... y lo hare como INTERES COMPUESTO ó SIMPLE (ambos) en JS:
Código Javascript
:
Ver original<html>
<head>
<script language="JavaScript">
function calcular()
{
var precio= parseFloat( document.getElementById("precio_no_tax").value);
var tax = 1+(parseFloat( document.getElementById("tax").value)/100);
var interes= (parseFloat( document.getElementById("interes").value)/100);
var cuotas= parseInt( document.getElementById("cuotas").value);
var interes_tipo= document.getElementById("interes_tipo").value;
if (interes_tipo =='compuesto')
// Calculo el interes como interes *compuesto*
var interes_total = Math.pow(1+interes,cuotas);
else
// Calculo el interes como interes *simple*
var interes_total = 1+(interes * cuotas);
var total = document.getElementById("total").value = (precio*tax*interes_total)/cuotas;
}
</script>
</head>
<body onload="calcular();">
<form method="POST" action="tu_script.php" name="form">
<tbody>
<tr>
<td>Precio(sin iva):</td>
<td><input type="text" id="precio_no_tax" name="price_notax" value="100" size="5" onkeyup="calcular();"></td>
</tr>
<tr>
<td>Cuotas:</td>
<td>
<select id="cuotas" onchange="calcular();">
<option value="6" selected>6</option>
<option value="12">12</option>
<option value="36">36</option>
</select>
</td>
</tr>
<tr>
<td>Interes %</td>
<td><input type="text" id="interes" value="3" size="1" onchange="calcular();"></td>
</tr>
<tr>
<tr>
<td>Tipo interes</td>
<td>
<select id="interes_tipo" onchange="calcular();">
<option value="simple" selected>Simple</option>
<option value="compuesto">Compuesto</option>
</select>
</td>
</tr>
<tr>
<td>Iva:</td>
<td>
<select id="tax" onchange="calcular();">
<option value="0" selected>Ninguna</option>
<option value="16">16</option>
<option value="30">30</option>
</select>
</td>
</tr>
<tr>
<td>Total:</td>
<td><input type="text" name="total" value="" id="total" size="3"></td>
</tr>
</body>
</html>