How to create Guest booking form and limit number of guests booking?

  • Profile Image
    Asked on February 24, 2018 at 07:50 AM

    Hello again,

    sorry for my million questions.

    I have a tricky one which I hope you will be able to help me.

    I add a picture so you can better understand. I'm sorry, I'm Italian so maybe my English is not the best one.

    1519476383Schermata 2018-02-24 alle 13.4

    I created this part to be filled.

    I would like to make something like this:

    I can only accommodate 6 totale people (mixed in adults, children and infants).

    If someone specifies 2 adults, 2 children and 1 infant.

    How can I manage to open the second part to insert the names of all the occupants to be no more than 6?

    1519476625Schermata 2018-02-24 alle 13.4

    I need something that calculates the 3 fields and opens the second part following the number of occupants required.

    I don't know if I explained the best.

    Can someone help me?

  • Profile Image
    Answered on February 24, 2018 at 01:47 PM

    Apologies for the challenges you are facing. You can be able to achieve the above by doing the following

    1. You will need to limit the number value of input entered in number field to 5 and not 6 as you have set in your form

    2 You will need to show an error message incase number of guests exceeds 5 guests. This can be done by using the "Text Field"in your form

    3. You will need to calculate the number of Guests as the user enters data in the "Numbers field". You can achieve this by using the Form Calculation Widget where you will capture the details and output the total number of guests in the calculation widget.

    4. You will need to create conditional logics that will check the values in the Form Calculation Widget and display the Guest name and Date of Birth fields appropriately. You will need to create multiple conditions that will check each instance that is if Guest is 1 then hide all the other fields, if guests are 2 then hide the other three fields, if guests are 3 then hide the other 2 guest fields.

    5. Last but not least you will need to disable submit and display error message incase user enters more than 5 guests this will ensure you do not get partial or wrong submissions.

    I have cloned your form and made the above changes and tested the form and works well. Kindly feel free to clone and use the form.

  • Profile Image
    Answered on February 24, 2018 at 03:11 PM

    Dear Trevor,


    Thank you so very much for your help.

    I copied your fields and it worked perfectly.

    You have been very kind.

  • Profile Image
    Answered on February 24, 2018 at 09:09 PM

    Thank you for the kind words, Apartmentalia. And on behalf of Trevor, you are very much welcome.

    Feel free to let us know if you have other questions or concerns.

    Warm regards.