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
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
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
javascript calculations in forms? - 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: javascript calculations in forms? (/showthread.php?tid=1573)



javascript calculations in forms? - bwaye - Aug 30th, 2011

I have a client whom would like to have the ability in the backend to use fields that can auto caculate. They want a quote system for clients to fill out BUT only have the calculations done INSIDE Formtools.

Has anyone done anything like this before?


RE: javascript calculations in forms? - Ben - Aug 31st, 2011

Cool! No, I haven't heard of that exactly - or at least, not done to any great extent. I've heard of people using the Submission Pre-Parser module to execute code to do math on the data (count things up, etc) and update a separate field - but not within the Form Tools interface.

How extensive is the math they want to do? What kind of things?

- Ben


RE: javascript calculations in forms? - bwaye - Aug 31st, 2011

They want to be able to the following.

Add a form to the website to collect QUOTE information for a wedding MINUS the cost (No Problems here).

They want the cost to be in the database for ONLY them to access (the whole competeror thing)

EXAMPLE:
Flower(s) cost X multiply by NUMBER = Total
Do this on multiple fields with a running total.

They also want a CLIENT owes X amount and be able to apply payments subtracting till 0.

I assume I can just pull all of the data out of FT and build an interface. As you know this will be no easier undertaking.


RE: javascript calculations in forms? - Ben - Aug 31st, 2011

Hi Brad,

Quote:I assume I can just pull all of the data out of FT and build an interface. As you know this will be no easier undertaking.

Yeah, kind of a pain...

Unfortunately, it would kind of take some custom work - like developing a separate module or hacking the interface or something. Doing a separate interface might give you more benefits in the long run: any small requirements change could be very complex to do if you're working within Form Tools.

Sorry about that. Sad

- Ben




RE: javascript calculations in forms? - jgold723 - Apr 25th, 2014

Just curious if anything has changed since this was posted. I too would like to have some auto calculating done on the fields in my database.


RE: javascript calculations in forms? - grahame - May 2nd, 2014

Hi

I have the same requirement for a 'quoting' form.... to replicate an existing Excel spreadsheet.

What I am doing is using the Hooks Manager (for ft_update_submission,start) to trap the incoming fields and to do calculations on them before they are stored. Early days but seems to work OK. Just watch out if you are using tabs and you want to alter a field on one tab based on changes in another. The UPDATE button only submits fields for that tab so you might have to do some jiggery pokery in SQL as well as the form's variables.