I'm very new to Javascript, here's my problem I can't seem to get the last two boxes right and sorry for my messed up coding as i said i'm still very new to this.
function FigureIt() {
DinCost = document.tip.dinCost.value;
Tip15 = (DinCost * .15)
Tip25 = (DinCost * .25)
Din15 = (DinCost * .15) + (DinCost)
Din25 = (DinCost * .25) + (DinCost)
document.tip.tip15.value = Tip15;
document.tip.tip25.value = Tip25;
document.tip.dinner15.value = Din15;
document.tip.dinner25.value = Din25;
}
<form name="tip">
How much did you pay for dinner? $<input type="text" name="dinCost" id="dinCost"> <br>
<input type="button" value="Calculate Tips" onclick="FigureIt()"> <br> <br> Amount of 15% tip: $<input type="text" name="tip15" id="tip15"> <br> Amount of 25% tip: $<input type="text" name="tip25" id="tip25"> <br> <br> Cost of dinner +
15% tip: <input type="text" name="dinner15" id="dinner15"><br> Cost of dinner + 25% tip: <input type="text" name="dinner25" id="dinner25"> <br>
<input type="reset" value="Erase">
</form>