• Resolved cegasol

    (@cegasol)


    Hi, I’m trying to hide and show fields, In the fourth calculator in the link. (ENTIRE CLASS BUNDLE PRICING CALCULATOR_PRORATED)

    I ‘ve already tried the conditional show options for each field. But the functionally I want cannot be achived in that way. So I made a hide and Show field and add some functions to it:

    (function(){
    CONDITIONS IN HERE
    })();

    It works fine for just one set of related fields.

    i.e

    Undergraduate > 1 Class > Yes >(Any time lapse) > Input number – Works Fine

    in the case above : fields involved are #49 # 50 # 8 #33 # 32 # 5

    When I tried to replicate it changing the set of fields, it doesn’t work.

    In example Undergraduate > 2 class > Yes > (Any time lapse) > Input Number —- DOESN’T WOrks.

    in this second case : fields involved are #49 # 53 #10 #35 # 34 # 17

    It might be a simpler way to ask if can have differents

    (function(){
    CONDITIONS IN HERE
    })();

    (function(){
    CONDITIONS IN HERE
    })();

    In a same field – or form .

    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 @cegasol

    I’m sorry, but I’m not sure about your project’s description. However, the plugin allows you to activate/deactivate the fields from the equation.

    I’ll try to describe the process with a hypothetical example.

    Assuming you want to deactivate the fields, fieldname1, fieldname2, and fieldname3

    But activate the fildname1 field if fieldname4 is equal to “Yes” and fieldname5 is lower than 10.

    Activate the fildname2 field if fieldname4 is equal to “Yes” and fieldname5 is greater than or equal to 10.

    Activate the fildname3 field if fieldname4 is equal to “No” and no matter the value of the fieldname5.

    Insert a calculated field in the form to be used as auxiliary with the equation:

    
    (function(){
    IGNOREFIELD(1);
    IGNOREFIELD(2);
    IGNOREFIELD(3);
    if(AND(fieldname4 == 'Yes', fieldname5<10)) ACTIVATEFIELD(1);
    if(AND(fieldname4 == 'Yes', 10<=fieldname5)) ACTIVATEFIELD(2);
    if(fieldname4 == 'No') ACTIVATEFIELD(3);
    })()
    

    As you can see, you can hide/deactivate fields by calling the IGNOREFIELD operation. Pass to this operation the number part of the field’s name. Furthermore, you can show/activate the field by calling the ACTIVATEFIELD operation.

    Best regards.

    Thread Starter cegasol

    (@cegasol)

    Hi, Thanks for the response,

    How can I implement on a fieldname that is checklist with several values, no matter what values are, how can I set the “selected” condition for that kind of field?

    Thanks! again

    Plugin Author codepeople

    (@codepeople)

    Hello @cegasol

    I’m not sure about your question. But assuming you have the checkbox field with three choices. If you want the first choice to be selected by default, you must tick the checkbox in front of the corresponding choice in the choices definition section:

    If one choice has the value 10, and you want to tick it from the equation, assuming the name of the checkbox field is the fieldname123, you can use the following piece of code as part of an equation:

    getField(123).setVal(10);

    Best regards.

    • This reply was modified 2 years, 10 months ago by codepeople.
    Thread Starter cegasol

    (@cegasol)

    Thanks! Again,

    The question could be more like this.

    I have several dropdowns fields #8, #10 # 12, and others (see image), that have common options (red rectangle) but different values each.

    If i’m setting a custom hide and show, How can I do to instead of put each value, in example: field 10 ==520, put the text ‘5 to 6 Weeks’

    I already tried fieldname10 === ‘5 to 6 Weeks’

    This is how the code is working.

    if ( AND(fieldname48 === 'Yes', fieldname10 == 520, fieldname49 > 6 )) {
    
        ACTIVATEFIELD(62);  
          }
    Plugin Author codepeople

    (@codepeople)

    Hello @cegasol

    If the fieldname10 field is a dropdown field and you want to check: fieldname10 == "5 to 6 Weeks" where 5 to 6 Weeks is the choice’s text. Please, follow the steps below:

    1. Select the “Choice Text” option for the “Value to Submit” attribute.

    2. Use the |v modifier with the field’s name in the conditional statement:

    fieldname10|v == "5 to 6 Weeks"

    Best regards.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘CUSTOM HIDE AND SHOW CFF DON’T COVER SEVERAL FUNCTIONS’ is closed to new replies.