Calculate Total using a Multi Select Field

Comments

3 comments

  • Hamid

    Hi,

    try with this code :


    var cat = @Catégorie;
    var cat1 = cat.indexOf("Option 1") >= 0 ? 5 : 0;
    var cat2 = cat.indexOf("Option 2") >= 0 ? 5 : 0;
    var cat3 = cat.indexOf("Option 3") >= 0 ? 5 : 0;
    cat1 + cat2 + cat3
    0
    Comment actions Permalink
  • Rainer Grabowski

    Or simply: 

    @Category.length * 5

    Rainer

    0
    Comment actions Permalink
  • Justin Cardenas

    Rainer - I have a similar question; however, my options have different values - Will the above code work or is there a much simpler way? For example:

    option 1 is 30 * @XYZ

    option 2 is 5000

    option 3 is 7.5 * @XYZ

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk