WordPress.org

Forums

Calculated Fields Form
[resolved] Create a dependencie with values between others values (3 posts)

  1. Ogeid87
    Member
    Posted 1 year ago #

    Hello,
    how can i create a dependencie like:

    (1) If x >= 100 and x <= 199 show ...

    and

    (2) If x >= 200 and x <= 299 show ...

    Can i do something of similar, where, if (1) and (2) are valid, will be shown only (2) ?

    Thanks
    Diego

    https://wordpress.org/plugins/calculated-fields-form/

  2. codepeople
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    First, both conditions cannot be true at the same time, because x can't be <= 199 and >= 200 at the same time.

    So the correct equation to evaluate each condition, separate one of the other, is (suppose that x is fieldname1 to use the same nomenclature that the plugin):

    (function(){
    if(fieldname1>=100 && fieldname1<=199) return ...;
    if(fieldname1>=200 && fieldname1<=299) return ...;
    })()

    Best regards.

  3. Ogeid87
    Member
    Posted 1 year ago #

    Thanks
    Diego

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Calculated Fields Form
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic