multiplying fields

  • standup
    Asked on May 24, 2022 at 3:55 AM

    How do I multiply number of guests field with number of nights staying field to generate a total price?

    I'm using the My Products field for number of guests wanting to stay, but I can't add a multiplyer to this for number of nights they want to stay.

    Is there a way to do this?

    thanks

  • Rica Support Team Lead
    Replied on May 24, 2022 at 4:40 AM

    Hello standup,

    Thanks for reaching out to Jotform Support. I believe you are referring to the Hotel Reservation Form. What I would suggest to achieve your requirement is:

    1. Add a hidden Form Calculation widget to calculate the number of nights that the guest is staying using the dates added on the Arrival and Departure field.

    1653379990 628c939696d4d Capture Screenshot 10

    2. Instead of adding the product to the Product List, use a Multiple Choice element to list the products and assign a Calculation Value.

    1653380925 628c973d76330 Capture Screenshot 21

    3. Add another hidden Form Calculation widget to calculate the Total. The formula should be (Products * Number of Guest) * Number of nights.

    1653381086 628c97ded8bce Capture Screenshot 32

    4. On the Product List, change the Payment Type to User Defined Amount.

    1653381187 628c9843849cf Capture Screenshot 43

    5. And then set the Get Price From Total field.

    1653381304 628c98b892723 Capture Screenshot 54

    You may test this workaround using this demo form. I have not hidden the Number of nights field and Total field for testing purposes.

    Let us know if there’s anything else we can help you with.