• Resolved barrye_dickinson

    (@barrye_dickinson)


    Hi
    I don’t know javascript so forgive this question.
    I would like the calculated field to be conditional on a text box answer: eg: if someone puts “january” (through to April) it will calculate fieldname+5 if they put “May” (through to December) it will calculate fieldname+6.
    Can you help me formulate the correct code?

    Thank you

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

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

    (@codepeople)

    Hello @barrye_dickinson,

    The names of fields alls begin with the text: fieldname, please, indicate exactly what field you want to use in the equation.

    Furthermore, you are using in your form a text field for entering the months names (fieldname17), actually, it is not the recommended control to use in this case because the users not always write what should. For example, they can write only Jan, or 1, or 01, etc. So, I recommend you to use a different control type, like a DropDown field.

    So, I’ll try to describe the process with an example. Assuming that the fieldname17 is DropDown field and the field used in the sum is the fieldname1, the equation would be similar to:

    
    IF(IN(fieldname17,['January', 'February', 'March', 'April']), fieldname1+5, fieldname1+6)
    

    Best regards.

    Thread Starter barrye_dickinson

    (@barrye_dickinson)

    Thanks heaps. I’ll try it as soon as I can

    Thread Starter barrye_dickinson

    (@barrye_dickinson)

    Yes, it works perfectly. Thank you so much!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Answer conditional on text’ is closed to new replies.