Dependencies

  • WebWizardWorkshop
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 49
  • Thank you received: 0

WebWizardWorkshop replied the topic: Dependencies

Great. Now no amount is showing at all throughout the selection process and none of the buttons are working; paypal nor reset.

Here's what I did.

First I renamed the paypal button from paypal to PayPalButton to be in agreement with the element name you gave it in your sample. In the PayPalButton's actionscript I changed from library to custom and added the following:

function ff_PayPalButton_action(element, action)
{
switch (action)
{
case 'click':
ff_getElementByName('bfPaymentSelect').value = 'Donation|0|' + ff_getElementByName('total').value + '|0';
ff_validate_submit();
break;
default:;
} // switch
} // ff_PayPalButton_action


I then removed the initial formula I had in the Amount and saved properties.


Then I used the formula below in the actionscript of the following fields: type, length, length2, quantity, frontal, closure, and total. All but the total have the action 'change' checked at the actionscript. The element total has none of the actions checked. The the element action ( ff_quantity_action ) was updated to correspond with the element it was being used in.

function ff_quantity_action(element,action)
{
ff_getElementByName('total').value =((
Number(ff_getElementByName('length').value) +
Number(ff_getElementByName('length2').value)) *
Number(ff_getElementByName('quantity').value) +
Number(ff_getElementByName('closure').value)+
Number(ff_getElementByName('frontal').value);
}
// ff_quantity_action



Now no amount shows and none of the buttons work. I must have gone off track somewhere.
#233220
  • Posts: 1955
  • Karma: 67
  • Thank you received: 238

mihaela replied the topic: Dependencies

Hello,

Regarding PayPal element please, make sure not to forget to add as explained in this step:

"3. Create another new element with the following properties. (Any fields not mentioned can be left blank.)
TYPE: Hidden input
LABEL: PayPal Select
NAME: bfPaymentSelect (This MUST be named exactly as shown.)
VALUE: 0.00
VALIDATION: None "

As for the calculation code:
I've created a form like yours and put in elements length, length2, quantity, closure and frontal the following code:
function ff_elementname_action(element, action)
{
    ff_getElementByName('total').value =
( Number(ff_getElementByName('length').value) +
Number(ff_getElementByName('length2').value) ) *
Number(ff_getElementByName('quantity').value) +
Number(ff_getElementByName('closure').value)+
Number(ff_getElementByName('frontal').value);
} // ff_elementname_action

Only in the 'type' select list I have this Actionscript code:
function ff_type_action(element, action)
{
   ff_getElementByName('length').value = "";
    ff_getElementByName('length2').value = "";
ff_getElementByName('total').value = 0;
} // ff_type_action
The calculation worked fine.

I'm sending you a zipped xml file containing the form so you can Install that package on your site and see how it works.

Regards,

Mihaela
#233247
Attachments:
  • WebWizardWorkshop
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 49
  • Thank you received: 0

WebWizardWorkshop replied the topic: Dependencies

One word "PERFECT!!!" I made a few modifications to get the form's reset behavior to behave in accordance with changes made by the user. Thank you. I still haven't figured out what I had wrong, but your imported scripts worked those calculations like a charm.
#233314
  • Posts: 1955
  • Karma: 67
  • Thank you received: 238

mihaela replied the topic: Dependencies

Hello,

I'm glad I've helped and that it is working now.
I'm not sure what was wrong either form your code, but the important part is that it is now working.

Regards,

Mihaela
#233356
The following user(s) said Thank You: WebWizardWorkshop
Moderators: ForumSupporttomeperica
Time to create page: 0.073 seconds

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

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€

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!

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