• Resolved alphagoldafrica

    (@alphagoldafrica)


    Hi,

    I really like your form. I’ve just started using it and I am trying to get the form to calculate correctly. Please may you help me.

    My url is https://ezumajets.com/book-a-flight/

    This is the formula I have entered:

    (function(){
    if(fieldname8 == ‘Hawker’? && fieldname9 == ‘An Aircraft’?) return 5000;
    })();

    I am trying to achieve the following objective:

    If field 8 is equal to hawker and in field 9 an aircraft has been chosen, then the value must be $5000.
    If field 8 is equal to hawker and in field 9 a set has been chosen, then the value must be number of passengers in field 12 multiplied by $1000.

    The aircraft can carry a maximum of 8 passengers but I would like to set the maximum passengers to 5. How do I do this?

    Please help me?

    Thank you

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @alphagoldafrica

    Your equation requires multiple conditional statements. Similar to:

    
    (function(){
        if(fieldname8=='Hawker'){
           if(fieldname9 == 'An Aircraft') return 5000;
           else return fieldname12*1000;
        }
        /** Here the other conditional statements **/
    })()
    

    As you can see, I’m nesting the conditional statements.
    Best regards.

    Thread Starter alphagoldafrica

    (@alphagoldafrica)

    You are a star. Thank you so much. Wow…I am very impressed. Thank you

    Plugin Author codepeople

    (@codepeople)

    Hello @alphagoldafrica

    Thank you very much.

    Best regards.

    Thread Starter alphagoldafrica

    (@alphagoldafrica)

    I tried adding the following formula beneath the formula you gave me above but it did not work. Where have I gone wrong?

    if(fieldname8==’Challenger CL604′){
    if(fieldname9 == ‘An Aircraft’) return 6000;
    else return fieldname12*750;

    If a user selects the Challenger in field 8 and chooses an “An Aircraft in field 9, I would like the calculation field to give 6000 but if a seat is booked, I would like the calculation field to give field 12 * 750

    Thank you,

    Thread Starter alphagoldafrica

    (@alphagoldafrica)

    Thank you very much. You are very helpful. I got the formula correct:-)

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Book a seat’ is closed to new replies.