• Resolved schnolly

    (@schnolly)


    Thanks for this great module!
    I have a question, hope you can help me.
    I’ve created a calculated field an two divs containing fields.
    If the entered value in the calculated field is <3000 div1 should be shown, if the value entered is >3000 div2 should be shown.

    The question is: When the form is first loaded the two divs are visible. I want them to be hidden and get vissible after the calculated field has been filled out.
    On another form i created using radio buttons all depedent fields are hidden on page load.

    Thanks in advance! Pip

    https://www.ads-software.com/plugins/calculated-fields-form/

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

    (@codepeople)

    Hi,

    In this case you should to use a calculated field as intermediary to check the conditions, and return an unique value for each case, for example:

    if the fieldname1 is equal to zero return 0, if the value of the fieldname1 is different to 0 but < 3000, return 1, and if the value of fieldname1 is > 3000, return 2, and finally, create three dependency rules in the calculated field, the first rule: if the value is zero, then display Div1 and Div2, if the value is 1, display the Div1, and the value is 2, then display the DIV2

    The equation would be:

    (function(){
    if(fielname1 == 0) return 0;
    if(fieldname1 < 3000 ) return 1;
    else return 2;
    })()

    Best regards.

    Thread Starter schnolly

    (@schnolly)

    Thanks! Will try that.
    Best regards, Pip

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hide divs (or field) on pageload’ is closed to new replies.