The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
|
![]() |
Totals on html form - Printable Version +- Form Tools (https://forums.formtools.org) +-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1) +--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5) +--- Thread: Totals on html form (/showthread.php?tid=695) |
Totals on html form - mikevid - May 10th, 2010 Hi, I'm using a html form that accepts quantities from the user which is then managed by formtools api. I'm looking for some guidance on how to add a total (sum of all entries) to the form that in turn will go to formtools. I googled around and found some code that will helps create the totals, but I don't know how to send that number to formtools. Any assistance would be appreciated. Thank you. RE: Totals on html form - Ben - May 15th, 2010 Hi Mikevid, Sure no worries. There's a couple of ways to do this, but it rather depends on how that code you found works. Is it javascript or PHP? If it's javascript, all you need to do is store that information in a hidden field (or visible - doesn't matter!) in your form, then tell Form Tools to look for that new form field and store it. You can do this via the Edit Form -> Database tab. If it's PHP, it'll be more complicated. Again, depending on it's complexity and whether or not it uses separate PHP library files, I'd be tempted to look into the Submission Pre-Parser module. That lets you run your own PHP code prior to it being added to the database. You may find you could just copy & paste that code into the Submission Pre-Parser rule and feed in the values from the POST submission. Again, this will require that you create an extra field in your form to store that information for each submission. Hope this helps a little, even in the abstract. ![]() - Ben |