Breezing Forms & Content Builder Conditional Fields

  • tyekynan
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 53
  • Thank you received: 2

tyekynan replied the topic: Breezing Forms & Content Builder Conditional Fields

I believe I may have had an extra { or } in my script somewhere as I have got this straightened out.

Now I have 2 other issues.

1. When I go to more options and initialization script, I don't have enough room for all of my conditional fields. When I save it, it cuts it off at the bottom removing the rest of the script.

2. I have some calculated fields:
(text) points_field

(hidden) ppp_field (price per point, we currently charge $18 per point)

(hidden) insurance_field (cost of insurance per point, we currently charge $2 per point)
(text) deposit_field

(text) total_field

(text) total_insurance_field (total with added insurance)

For the total_field, all I need to do is multiply points_field value by ppp_field value minus the deposit field.

So: total_field = points_field * ppp_field - deposit field

For the total_insurance_field I need an if statement, example:

If point_field is < 100 then:
total_insurance_field = points_field * ppp_field - deposit +200
(we have a $200 minimum on insurance cost)

If point_field is > 100 then:
total_insurance_field = points_field * (ppp_field + insurance_field) - deposit

I hope this makes sense, if not please let me know. You are always of great help and I appreciate it.
#233914
  • tyekynan
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 53
  • Thank you received: 2

tyekynan replied the topic: Breezing Forms & Content Builder Conditional Fields

Hey guys, I hate to be a burden and I am trying to be patient. I know you guys are pretty busy, but could someone give me a hand with this? This form is a beast and I would love to get it finished up and move to greener pastures.
#233983
  • mihaela
  • Away
  • Administrator
  • Administrator
  • Posts: 2727
  • Karma: 93
  • Thank you received: 369

mihaela replied the topic: Breezing Forms & Content Builder Conditional Fields

Hello,

I apologize for the late response.

1. I think that in this case you will have to remove part of initialization script in the Actionscript.
Can you please send me backedn login info to mihaela.kobovac@crosstec.org so I can take a look into this from first hand since I haven't had a case of a too long script. Please in the email write the name of the form that I should look at.

2. As for the calculation, It does make sense. :) Please take a look at this piece of documentation crosstec.org/en/support/online-documenta...ting-textfields.html to see how to achieve what you want.

In your case, calculation code that you would put in framework is the following:
ff_getElementByName('total_field').value =
Number(ff_getElementByName('points_field').value) *
Number(ff_getElementByName('ppp_field').value)-Number(ff_getElementByName('deposit_field').value);

if( Number(ff_getElementByName('points_field').value) <= 100 ) {
ff_getElementByName('total_insurance_field').value =
Number(ff_getElementByName('points_field').value) *
Number(ff_getElementByName('ppp_field').value)-Number(ff_getElementByName('deposit_field').value) + 200;
}
else if( Number(ff_getElementByName('points_field').value) > 100 ) {
ff_getElementByName('total_insurance_field').value =
Number(ff_getElementByName('points_field').value) *
( Number(ff_getElementByName('ppp_field').value) + Number(ff_getElementByName('insurance_field').value) ) - Number(ff_getElementByName('deposit_field').value);
}

You should put that code(in framework) in the Actionscript of the follwoing fields: "points_field", "ppp_field", "insurance_field" and "deposit_field" as explained in the article on the link that I've sent you.

Let me know whether you've managed to make the calculations work as wanted.

Regards,

Mihaela
#233986
  • tyekynan
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 53
  • Thank you received: 2

tyekynan replied the topic: Breezing Forms & Content Builder Conditional Fields

Okay, I am having issues getting this to work the way I would like. So, I broke it down into something more simple. Here is what is happening.

point_field (actionscript: custom & change: checked)

function ff_point_field_action(element, action)
{
ff_getElementByName('total_field').value =
Number(ff_getElementByName('points_field').value) * 18;
} // ff_point_field_action



total_field (actionscript: custom & nothing checked)

function ff_total_field_action(element,action)
{
ff_getElementByName('total_field').value =
Number(ff_getElementByName('points_field').value) * 18;
}
// ff_total_field_action


I am getting this-ReferenceError: ff_points_field_action is not defined

By my calculations, it should take the entered amount in "point_field" and multiply it by 18. Anytime I change that value it should change it in the "total_field"
#233989
  • mihaela
  • Away
  • Administrator
  • Administrator
  • Posts: 2727
  • Karma: 93
  • Thank you received: 369

mihaela replied the topic: Breezing Forms & Content Builder Conditional Fields

Hello,

From what you have written I assume this error is caused by putting the wrong element name.

You write that this is the Actionscript code:
function ff_point_field_action(element, action)
{
ff_getElementByName('total_field').value =
Number(ff_getElementByName('points_field').value) * 18;
} // ff_point_field_action

And the error you are getting is:
ReferenceError: ff_points_field_action is not defined

Therefore I assume that field's Name is "points_field" so the code should look like this:
function ff_points_field_action(element, action)
{
ff_getElementByName('total_field').value =
Number(ff_getElementByName('points_field').value) * 18;
} // ff_points_field_action

Let me know whether after you change this your form is works.

Regards,

Mihaela
#233993
  • tyekynan
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 53
  • Thank you received: 2

tyekynan replied the topic: Breezing Forms & Content Builder Conditional Fields

I think that did it, I have it working now though! Your time and efforts are very much appreciated. VERY MUCH. Thanks for all of your help.
#234025
Moderators: ForumSupporttomeperica
Time to create page: 0.106 seconds

New Icon Packs Category!

Crosstec is now offering icon packs.

If you are a paying subscriber, icon packs are automatically added to your account.

Check out our icon packs page!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Summer Sale!

50% discount on all of our extension subscription plans, templates and icon packs!

Get Your Subscription Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99 for just 49! (Summer Sale)

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

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!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here