michelle1404 Posted June 7, 2014 Share Posted June 7, 2014 Hello, I want to calculate the difference between 2 textbox value live. I found this solution for adding http://forums.phpfreaks.com/topic/131592-solved-get-the-sum-of-many-text-box-values/ , but dont know how to convert this for subtracting here is my form echo '<tr><td></td><td style="text-align:center;">TOTAL</td><td style="text-align:center;"><input type="text" readonly="readonly" name="payamount" value='.$total.' style="text-align:center; font-weight:bold; font-size:13px;" ></td></tr>'; echo'<form name="form1" method="post" action="" > <tr><td></td><td style="text-align:center;">Advance</td><td style="text-align:center;"><input type="text" name="advance" ></td></tr> <tr><td></td><td style="text-align:center;">Discount</td><td style="text-align:center;"><input type="text" name="discount" ></td></tr> <tr><td></td><td style="text-align:center;">Total Payable</td><td style="text-align:center;"><input type="text" name="total" id="total"/></td></tr> <tr><td><input type="submit" name="submit" value="PAY NOW" > when i enter the value for advance and discount, it should subtract these values with Total and should get entered in Total Payable text box Quote Link to comment https://forums.phpfreaks.com/topic/289046-auto-calculate-the-difference/ Share on other sites More sharing options...
Solution michelle1404 Posted June 7, 2014 Author Solution Share Posted June 7, 2014 Sorry, This is solved Quote Link to comment https://forums.phpfreaks.com/topic/289046-auto-calculate-the-difference/#findComment-1482156 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.