pastorandy
IS-IT--Management
I have two form fields and I want to be able to subtract the value from one. What I currently have doesn't work.
I haven't written a javascript function before but this is what I have:
I was hoping that whatever value was in payment_deduction would get subtracted from payment amount.
I have the two form fields and a button to trigger the function:
Could someone point me in the right direction?
I haven't written a javascript function before but this is what I have:
Code:
<script language="JavaScript">
function deduct()
{
document.form1.payment_amount.value = --document.form1.payment_deduction.value;
}
</script>
I have the two form fields and a button to trigger the function:
Code:
<input type="button" name="btnSub" onClick="javascript:deduct();">
Could someone point me in the right direction?