TOPIC:

Calculations and formulas 2 weeks 1 day ago #243046

  • Topic Author
  • dairo
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 4
  • Thanks: 0
I've seen that I can use breezing forms for some calculations. How can I do the following?

Someone has 2 options:

Option 1:

64-(20*(A1/B1))

Option 2:

76-(20(A1/C1))

Result: Option 1 or Option 2 depending on what they chose in the previous element.

PS: Is there an option to create more advanced formulas that I can learn?

Thanks.

Please Log in or Create an account to join the conversation.

Calculations and formulas 2 weeks 1 day ago #243052

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 233
  • Karma: 3
  • Thanks: 40
Hi,

you want that the user enter values ​​for a1, b1, c1 in textfield and then select one of these two options and after that the total price appears?

Regards,
Tihana

Please Log in or Create an account to join the conversation.

Last edit: Post by TheMuffinMan.

Calculations and formulas 2 weeks 1 day ago #243120

  • Topic Author
  • dairo
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 4
  • Thanks: 0
Yes, Tihana,
The first options are to choose their gender

1. Male
2. Female

The first formula is for men and the second for women.

I need to know their stats.

I will ask for values A1, B1, and C1. (Age, Weight, and Height)

Then I will create another element with the answer (the answer can be overwritten in case they have their own)

Thanks.

Please Log in or Create an account to join the conversation.

Last edit: Post by dairo.

Calculations and formulas 2 weeks 21 hours ago #243135

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 233
  • Karma: 3
  • Thanks: 40
Hi,

I create an example for you. I hope it will be of help to you.

File Attachment:

File Name: calculations.zip
File Size:9 KB


For each form element is added Actionscript (A1, B1, C1, Male, Female, and total).
In form element total a calculation is performed.
Go to your form element A1->Advanced->Actionscript->Custom->check change->Create code framework:
function ff_a1_action(element, action)
{
    ff_total_action(element,action);
} // ff_a1_action
Do the same for the other element (B1,C1,Male, Female).

Since the calculation is performed in the form element total, the code is as follows:
function ff_total_action(element, action)
{
   ff_getElementByName('total').value=0;
{
   if(ff_getElementByName('options1').checked)
   {
      ff_getElementByName('total').value=64-20*((Number(ff_getElementByName('a1').value)/Number(ff_getElementByName('b1').value)));
   }
     if(ff_getElementByName('options2').checked)
   {
      ff_getElementByName('total').value=76-20*((Number(ff_getElementByName('a1').value)/Number(ff_getElementByName('b1').value)));
   }
}
} // ff_total_action
PS: total is name of form element total, options1 is value of Male, and options2 is value of Female.
Note: This is just an example of a calculation. please customize it for yourself and what you want.

Let me know if you need further asistance.

Regards,
Tihana
Attachments:

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Moderators: ForumSupport
Time to create page: 0.049 seconds

July Sale!

Discounts for all of our extensions + support. Ending July 31st!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!