TOPIC:

Setting a Value for an Element 1 month 3 weeks ago #251293

  • bruce@brucedill.com's Avatar Topic Author
  • bruce@brucedill.com
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 738
  • Karma: 1
  • Thanks: 9
The field I am wanting to set is “entry_fees”

There are multiple other elements which determine the setting of “entry_fees”

1) If the user selects “Yes” on “enter_show_1” then add the value of “entry_fee_primary_day_1” to “enter_fees”

2) If the user selects “Yes” on “enter_sweeps_event_1” then add the value of “sweeps_entry_fee_event_1” to “enter_fees”

3) If the user selects “Yes” on “obedience_enter_event_1” then add the value of “obedience_fee_event_1” to “enter_fees”

4) If the user selects “Yes” on “rally_enter_event_1” then add the value of “rally_fee_event_1” to “enter_fees”

I am thinking we need to add code to the ACTIONSCRIPT for each of the “YES” elements to recalculate the amount for the “entry_fees” element.

I would be glad to provide you access credentials and the specific form information.
I really need this as soon as possible.

Thank you for your help.

Bruce

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

Setting a Value for an Element 1 month 3 weeks ago #251294

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

something like this in actionscript->change:
1)
function ff_enter_show_1_action(element, action)
{
    switch (action) {
        case 'change':
if (element.value == 'Yes') {
ff_getElementByName('entry_fee_primary_day_1').value = "entry_fees";
}

            break;
        default:;
    } // switch
} // ff_enter_show_1_action

2)
function ff_enter_sweeps_event_1_action(element, action)
{
    switch (action) {
        case 'change':
if (element.value == 'Yes') {
ff_getElementByName('sweeps_entry_fee_event_1').value = "entry_fees";
}

            break;
        default:;
    } // switch
} // ff_enter_sweeps_event_1_action

and so on for each selection


Hope this helps

Regards,
Tihana

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

Last edit: Post by tihana.krivic.

Setting a Value for an Element 1 month 3 weeks ago #251295

  • bruce@brucedill.com's Avatar Topic Author
  • bruce@brucedill.com
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 738
  • Karma: 1
  • Thanks: 9
OK,

What happens if the user saves the record and the next day changes the value to "No"?

I wonder if the value for "entry_fees" should be set to "0" every time the user changes the "Yes"/"No" element and then recalculate the value based on the elements related to the total "entry_fees".

Thoughts?

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

Setting a Value for an Element 1 month 3 weeks ago #251302

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

yep.
If someone select 'No', value for ff_getElementByName('entry_fees').value is set to 0.
You mean on this?

Regards,
Tihana

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

Setting a Value for an Element 1 month 3 weeks ago #251315

  • bruce@brucedill.com's Avatar Topic Author
  • bruce@brucedill.com
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 738
  • Karma: 1
  • Thanks: 9
Yes BUT once entry_fees is set to "0" we need to check all other elements related to "entry_fees" and add values if the element is "Yes" or don't add them if set to "no".

I appreciate your help.

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

Setting a Value for an Element 1 month 3 weeks ago #251318

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

ah, understand.
I read again your first message

1) If the user selects “Yes” on “enter_show_1” then add the value of “entry_fee_primary_day_1” to “enter_fees”
function ff_enter_show_1_action(element, action)
{
    switch (action) {
        case 'change':
if (element.value == 'Yes') {
ff_getElementByName('enter_fees').value=ff_getElementByName('enter_fees')+ff_getElementByName('entry_fee_primary_day_1').value;
}
            break;
        default:;
    } // switch
} // ff_enter_show_1_action

2) If the user selects “Yes” on “enter_sweeps_event_1” then add the value of “sweeps_entry_fee_event_1” to “enter_fees”
function ff_enter_sweeps_event_1_action(element, action)
{
    switch (action) {
        case 'change':
if (element.value == 'Yes') {
ff_getElementByName('enter_fees').value=ff_getElementByName('enter_fees').value + ff_getElementByName('sweeps_entry_fee_event_1').value;
}

            break;
        default:;
    } // switch
} // ff_enter_sweeps_event_1_action

//and so on

Hope this helps

Regards,
Tihana

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

Time to create page: 0.053 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

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!