fbpx
Welcome, Guest
Username: Password: Remember me

TOPIC: Calculations in form

Calculations in form 1 month 2 weeks ago #31280

  • ronrei
  • ronrei's Avatar
  • Offline
  • New Member
  • Posts: 4
  • Karma: 0
I'm using JDSimple Contact Form for the first time and want to know if it is posible to make calculations in the reply form.
I want to make a simple calculation.
The user enters a number of concertstickets they want to have.
I need to calculate the total amount they have to pay.
Thanks in advance.
Ron
The administrator has disabled public write access.

Calculations in form 1 month 2 weeks ago #31285

  • lousyfool
  • lousyfool's Avatar
  • Offline
  • Senior Member
  • Posts: 64
  • Thank you received: 4
  • Karma: 0
Well, as the name implies, it's a contact form (and a simple one). So, out of the box: no.
So, you'd need a bit of custom JS to make it work.

If you need professional and affordable help due to a lack of experience or in-depth knowledge of web development etc, including Joomla, config, structure & design, customisations or avoidance/fixing of errors: contact me at This email address is being protected from spambots. You need JavaScript enabled to view it. (English or German)
The administrator has disabled public write access.

Calculations in form 1 month 2 weeks ago #31289

  • ronrei
  • ronrei's Avatar
  • Offline
  • New Member
  • Posts: 4
  • Karma: 0
Thanks for the answer.
I tried to put in some JS in the Email Template but it disapears.
Can you give me some instruction on how and where to put in the JS
Regards Ron
The administrator has disabled public write access.

Calculations in form 1 month 2 weeks ago #31290

  • lousyfool
  • lousyfool's Avatar
  • Offline
  • Senior Member
  • Posts: 64
  • Thank you received: 4
  • Karma: 0
There is no such thing as "JS in emails" -- thankfully, as it'd be a security risk.

So, it can only be used (and the calc result displayed) on the website. If you want the result also to show in the email, obviously you'll need to have a (read-only) form field for it and write the script accordingly.

Best, you place the JS in a view override.
Or, depending on the J! template you're using, you may add it as "Custom JS" (then it'll load on every page the template style is assigned to, which may bother you or not).
Or you utilise one of the plugins from JED which let you run extra/custom code or load specific files on specific pages (though that seems almost overkill for only this use case).

If you need professional and affordable help due to a lack of experience or in-depth knowledge of web development etc, including Joomla, config, structure & design, customisations or avoidance/fixing of errors: contact me at This email address is being protected from spambots. You need JavaScript enabled to view it. (English or German)
The administrator has disabled public write access.

Calculations in form 1 month 2 weeks ago #31303

  • ronrei
  • ronrei's Avatar
  • Offline
  • New Member
  • Posts: 4
  • Karma: 0
Thanks for the answers.

I'm new to Joomla, not programming. I started using Joomla just a couple of months ago.
So please help me out with some code of website with some examples.
What I want is:
I have a numeric field in Jd Simple Contact (tickets).
I want to multiply this with let say €10
And display the result on the form in field "Total"

I would be very pleased and also the choir I do this fore.
Regards Ron
The administrator has disabled public write access.

Calculations in form 1 month 2 weeks ago #31304

  • lousyfool
  • lousyfool's Avatar
  • Offline
  • Senior Member
  • Posts: 64
  • Thank you received: 4
  • Karma: 0
It's a custom job, and one has got to have the knowledge and expertise for the required coding. Plus the time including testing etc, and at least frontend and FTP access to your site. So, please don't expect some "plug & play" code and instructions here.

This being a "simple contact" form only, alternatively you might as well look for a different extension capable of what you need out of the box.

If you need professional and affordable help due to a lack of experience or in-depth knowledge of web development etc, including Joomla, config, structure & design, customisations or avoidance/fixing of errors: contact me at This email address is being protected from spambots. You need JavaScript enabled to view it. (English or German)
The administrator has disabled public write access.

Calculations in form 1 month 2 weeks ago #31322

  • dankra
  • dankra's Avatar
  • Offline
  • Premium Member
  • Posts: 144
  • Thank you received: 5
  • Karma: 1
Not sure if this will do the job but have a look?
The administrator has disabled public write access.

Calculations in form 1 month 2 weeks ago #31323

  • ronrei
  • ronrei's Avatar
  • Offline
  • New Member
  • Posts: 4
  • Karma: 0
Thanks for all the answers.
I think I found a solution in the extention "QuickForm".

Thank for all the efforts.
Ron
The administrator has disabled public write access.
Moderators: akash, chandandeep
Time to create page: 0.449 seconds
Cron Job Starts