Login
Please enter your email address and password to login to the help desk.
(leave blank if you forgot your password)
   Save my login information
 

IMPORTANT NOTE:

DUE TO STUCTURAL CHANGES, THE TICKET SYSTEM IS NO LONGER ACCEPTING TICKETS. IF YOU ARE A PAYING SUBSCRIBER, PLEASE LOGIN TO THE CROSSTEC SITE AND USE THE CLUB FORUMS. THE CLUB FORUMS CATEGORY WILL APPEAR RIGHT AFTER LOGIN IF YOU ARE A PAYING CUSTOMER:

>>> Click here to access the forums <<<

We will close the knowledgebase soon as well and move its contents into a new knowledgebase system.

Knowledge Base » BreezingForms » FAQ
Change Page on Condition

 

I have a booking form where the user will have the option of adding details for additional travelers. Is there a way I can change the page conditionally based on the number they select?

 

You can do this by putting a custom action on the element. For example, if you are using a select-list to show the number of travelers -- say from 1 to 6 -- your list would look like this:

0;1;1
0;2;2
0;3;3
0;4;4
0;5;5
0;6;6

For the purpose of this example, let's name the element NumberOfTravelers.

Then go to the Advanced tab of the select-list.

Type: CUSTOM
Action: CHANGE (third checkbox from the left)

Click on CREATE CODE FRAMEWORK. A screen will popup that says:

Create code framework for action now?
(Existing code will be appended)

Click on OK. In the text area, you will see something like this:

function ff_NumberOfTravelers_action(element, action)
{
    switch (action) {
        case 'change':
            break;
        default:;
    } // switch
} // ff_NumberOfTravelers_action


Change it to:

function ff_NumberOfTravelers_action(element, action)
{
    switch (action) {
        case 'change':
if( element.value == '1' ){
  ff_switchpage(7);
} else if( element.value == '2' ){
  ff_switchpage(2);
} else if( element.value == '3' ){
  ff_switchpage(3);
} else if( element.value == '4' ){
  ff_switchpage(4);
} else if( element.value == '5' ){
  ff_switchpage(5);
} else if( element.value == '6' ){
  ff_switchpage(6);
}
            break;
        default:;
    } // switch
} // ff_NumberOfTravelers_action


IMPORTANT: If your element is named something OTHER than NumberOfTravelers, then you need to change the function to match the name. For example, if your element is named Travelers, then the function line would change to:

function ff_Travelers_action(element, action)

 

Was this helpful? Yes No Print Pdf