The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
|
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. - 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. |