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

    (@codepeople)

    Hi,

    I’m sorry for delay. I’ve checked your form, and the current equation is:

    (function(){
    if(Quantity == 500 && paper == glossy && Delivery Required ==Yes );
    return 500;
    })()

    First, you should use the field names in the equations, but not the labels:

    Quantity: in your form, correspond to fieldname2.
    paper: to fieldname4.
    delivery: to fieldname5.

    Second, values like “glossy” or “Yes” are strings, so should be inserted between quotes or double quotes.

    So, the correct version of your current equation is:

    (function(){
    if(fieldname2 == 500 && fieldname4 == ‘glossy’ && fieldname5 ==’Yes’ );
    return 500;
    })()

    As you can see, your current equation considers only a combination of values, you should complete your equation with all possible combination in the values of the other fields (by the way, only the first choice in the fieldname2 has a value associated, the others choices have not associated any value)

    Best regards.

    Thread Starter inetgoa

    (@inetgoa)

    Thanks a ton ! it works

    However

    1) when i select 1000 as the quantity the amount 500 should get cleared, which is not happening

    2) How do I use multiple combinations? I tried using the following

    (function(){

    if(fieldname2==’500′ && fieldname4==’glossy’ && fieldname5==’Yes’ );
    return 500;

    if(fieldname2==’1000′ && fieldname4==’glossy’ && fieldname5==’Yes’ );
    return 600;

    })()

    It doesn’t work? Is there any syntax problem ?

    Thanks

    Plugin Author codepeople

    (@codepeople)

    Hi,

    The reason is simple, I explained it in the previous entry. The equation is fine, but the values in the fieldname2 are not.

    You have entered the value only for the first choice of fieldname2, you should enter the values of the other choices too (in the other choices, you have entered only the text).

    Best regards.

    Thread Starter inetgoa

    (@inetgoa)

    Thanks again !

    Ive done that now

    I have put values for all the choices now, it still doesn’t seem to work . It returns 500 but not 600
    —————————-
    (function(){

    if(fieldname2==’q500′ && fieldname4==’pglossy’ && fieldname5==’dYes’ );
    return 500;
    if(fieldname2==’q1000′ && fieldname4==’pglossy’ && fieldname5==’dYes’ );
    return 600;
    })()

    —————————–

    Plugin Author codepeople

    (@codepeople)

    Hi,

    Use always the numeric value, because the plugin extracts the numbers from the choices’ values, and the “;” symbol cannot be set at the end of conditional statement. The correct is:

    (function(){
    if(fieldname2==500 && fieldname4==’pglossy’ && fieldname5==’dYes’ )
    return 500;
    if(fieldname2==1000 && fieldname4==’pglossy’ && fieldname5==’dYes’ )
    return 600;
    })()

    Best regards.

    Thread Starter inetgoa

    (@inetgoa)

    Thanks a lot !

    Works like a breeze

    Appreciated !!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Simple but not working..please help’ is closed to new replies.