Add additional fields when Radio Button Option is selected.

  • sauerlu
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 18
  • Thank you received: 0

sauerlu created the topic: Add additional fields when Radio Button Option is selected.

Dear sirs or madams,

I've a question. I'm using de latest version of Breezing Forms Pro + Joomla.

I want do build a form, which starts with 2 radio buttons on page 1
(option a and option b). Every option has other fields and I don't to make 2 diffrent forms.

Start (page 1)
Radiobuttons (choice A or B)

Option A (page 2):
Field 1
Field 2
Field 3
...

OR

Option B (page 3):
Field a
Field b
Field c
...

- When I select "option A" I want fill out all fields of option A (page 2) then Submit
or
- When selecting "option B" I want fill out all fields of option B (page 3) then Submit

Thanks a lot for your help :)

F.
#236320
  • Posts: 2735
  • Karma: 93
  • Thank you received: 369

mihaela replied the topic: Add additional fields when Radio Button Option is selected.

Hello,

To make your form work as you want please follow these steps:

1) Go to your form's Properties and set Paging include to No. That will remove all next and back buttons.

2) Create a custom next button. Create new element of Submit button type. What you write in Value field for that button element is what will be displayed on that button in your form, so that it the place where you should put, for example, "NEXT".

3) Go to Advanced properties of that next button element and in Actionscript section set Type to Custom and mark Click as Action.
In the code are below put the code similar to this:
function ff_NextButtonName_action(element, action) 
{
 if(typeof bfUseErrorAlerts != 'undefined'){
     JQuery(".bfErrorMessage").html('');
     JQuery(".bfErrorMessage").css("display","none");
    }
    error = ff_validation(ff_currentpage);
    if (error != '') {
        if(typeof bfUseErrorAlerts == 'undefined'){
           alert(error);
        } else {
           bfShowErrors(error);
        }
        ff_validationFocus('');
    } else
    switch ( JQuery('[name="ff_nm_radiogroupname[]"]:checked').val() ) {
        case 'A':
ff_switchpage(2);
            break;
        case 'B':
ff_switchpage(3);
break;
        default:
ff_switchpage(4); //dernière page
break;
    } // switch
} // ff_NextButtonName_action
NOTE: You need to replace NextButtonName with the name of that custom submit next button that you have created.
Also, you need to replace radiogroupname with the Name of the radio group depending on which the page is defined.

4) Go to your form's Properties and set Include submit button to No. That will remove regular submit buttons.

5) On page 2 create new element of Submit button type. What you write in the Value field for that button element is what will be displayed on that button in your form, so that it the place where you should put, for example, "SUBMIT" since this button will use to submit the form.

6) Go to Advanced properties of that next button element and in Actionscript section set Type to Library and mark Click as Action. Then select the FF::ff_validate_submit.

7) Create another submit button on page 3 following instructions from 5) and 6).

Let me know whether you have managed to set this for your form.

If you have more questions, feel free to ask.

Regards,

Mihaela
#236321
The following user(s) said Thank You: sauerlu
  • sauerlu
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 18
  • Thank you received: 0

sauerlu replied the topic: Add additional fields when Radio Button Option is selected.

Thanks a lot.

Everything works fine! :)
#236328
  • Posts: 2735
  • Karma: 93
  • Thank you received: 369

mihaela replied the topic: Add additional fields when Radio Button Option is selected.

Hello,

Great, I'm glad I've helped and that it is working as you wanted. :)

Regards,

Mihaela
#236335
Time to create page: 0.065 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