FORUMS


The Form Tools forums are no longer active, but the old posts have been archived here. Please see the Help page on how to get help / report issues.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
javascript calculations in forms?
#1
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?
Reply
#2
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
Reply
#3
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.
Reply
#4
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

Reply
#5
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.
Reply
#6
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.

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)