[réglé] reactive pages

  • beheliod
  • Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 29
  • Thank you received: 0

beheliod created the topic: [réglé] reactive pages

Hello

If it is possible to display or not these sections or elements according to a choice in a question, is it possible to perform to interact in the same way with pages?
That is to say if, for exemple, on page 1 I select the option A of the first question, I wish to be redirected directly to page 3 of the form.

Best regards
#235310
  • Posts: 2246
  • Karma: 77
  • Thank you received: 298

mihaela replied the topic: reactive pages

Hello,

It is possible to achieve what you want.

You can hide or show elements and sections in your form based on a choice in a question using visibility rules as explained here crosstec.org/en/support/online-documenta...f-conditionally.html .

As for skipping pages that can be done by adding custom next buttons in a way that it checks what was entered in that selection field and based on that redirects to wanted page.
Other, simpler way you can do that is if you want the user to be immediately redirected after choosing option A. Then you could add Actionscript to the selection field where A can be selected.

You can take a look at this topic reagarding that crosstec.org/en/forums/3-breezingforms-f...nt-value.html#234381 or this one crosstec.org/en/forums/35-form-help/1256...-on-load.html#233359 .

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

If you have more questions, feel free to ask.

Regards,

Mihaela
#235311
  • Posts: 136
  • Karma: 1
  • Thank you received: 14

Eddy.vh replied the topic: reactive pages

Hello.
Same approche… hi Olivier and Mihaela.
A form on which I integrated submit buttons that point to another page of the form according to the choice made by the user. It works well but the code put in place on the buttons is incomplete, it does not check if the required fields are well filled.

Here is the code for one of these buttons:
function ff_suivant_action (element, action)
{
switch (JQuery ('[name = "ff_nm_choix []"]: checked'). val ()) {
case 'A':
ff_switchpage (2);
break;
case 'B':
ff_switchpage (3);
break;
default:
ff_switchpage (4); //last page
break;
} // switch
} // ff_next_action

How can I add the control code for the required fields?
I tried inserting the code part of the script ff_validate_nextpage but then nothing works anymore.

Thanks for your help.
#235314
  • Posts: 136
  • Karma: 1
  • Thank you received: 14

Eddy.vh replied the topic: reactive pages

Hey Olivier, Mihaela,

Just think ...
I added script code ff_validate_page like this and the buttons work perfectly and validate the required fields :
	function ff_suivant_action(element, action) // Suivant est le nom du bouton
{
 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_choix[]"]:checked').val() ) {
        case 'A':
ff_switchpage(2);
            break;
        case 'B':
ff_switchpage(3);
break;
        default:
ff_switchpage(4); //dernière page
break;
    } // switch
} // ff_suivant_action

The problem is solved
#235322
  • Posts: 2246
  • Karma: 77
  • Thank you received: 298

mihaela replied the topic: reactive pages

Hello,

I was just about to send you almost the same script as the one you've just sent to validate the page and if all required fields are filled redirects to one of the pages.

Good job that you have managed to write the script yourself. :)

Regards,

Mihaela
#235323
  • Posts: 136
  • Karma: 1
  • Thank you received: 14

Eddy.vh replied the topic: reactive pages

Mihaela

I thank you for your nice compliment :)

learning by doing
#235325
Moderators: ForumSupporttomeperica
Time to create page: 0.072 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