Bienvenido, Invitado
Recordarme

TEMA:

Add additional fields when Radio Button Option is selected. 1 año 10 meses antes #236320

  • Autor del tema
  • sauerlu
  • Fuera de línea
  • Fresh Breezer
  • Fresh Breezer
  • Mensajes: 18
  • Gracias recibidas: 0
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.

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Add additional fields when Radio Button Option is selected. 1 año 10 meses antes #236321

  • mihaela
  • Fuera de línea
  • Developer
  • Developer
  • Mensajes: 3128
  • Karma: 105
  • Gracias recibidas: 415
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
El siguiente usuario dijo gracias: sauerlu

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Última Edición: Post by mihaela.

Add additional fields when Radio Button Option is selected. 1 año 10 meses antes #236328

  • Autor del tema
  • sauerlu
  • Fuera de línea
  • Fresh Breezer
  • Fresh Breezer
  • Mensajes: 18
  • Gracias recibidas: 0
Thanks a lot.

Everything works fine! :)

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Add additional fields when Radio Button Option is selected. 1 año 10 meses antes #236335

  • mihaela
  • Fuera de línea
  • Developer
  • Developer
  • Mensajes: 3128
  • Karma: 105
  • Gracias recibidas: 415
Hello,

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

Regards,

Mihaela

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

  • Página:
  • 1
Tiempo de carga de la página: 0.052 segundos