killian_walsh@hotmail.com Posted January 12, 2007 Share Posted January 12, 2007 Hi,I'm new to this so bare with me.I have a PHP form that has a number of Numeric fields. I also have a Total Amount field. How to I add the values of the other numeric fields and populate the Total field with the result.The form details are being sent to a MySQL database. Would it be easier to add the fields on the MySQL side using some SQL code?Fields:amount1amount2amount3totalamountThanks in advance.Killian Quote Link to comment https://forums.phpfreaks.com/topic/33882-adding-numeric-filds-in-a-php-form-to-display-a-total/ Share on other sites More sharing options...
HuggieBear Posted January 12, 2007 Share Posted January 12, 2007 If you want to display it on the page, then you're better of using a client-side language like JavaScript, this will save you submitting the form every time something gets changed.That of course is assuming that amount1, amount2, and amount3 are all editable on the page that's displaying the values for them.RegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/33882-adding-numeric-filds-in-a-php-form-to-display-a-total/#findComment-159022 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.