The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 909 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1370 fetch_forum_permissions
/printthread.php 76 forum_permissions
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
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. Smile

- Ben