Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 85594

Re: Add 2 unlike fields together

$
0
0

If you set the export value of the checkbox to 5, the script custom calculation script can be:

 

// Custom calculation script

(function () {

 

    // Get the field values

    var v1 = getField("SKL_1").value;

    var v2 = getField("TRN").value;

 

    // Perform the calculation

    if (v2 !== "Off") {

        event.value = v1 * v2;

    } else {

        event.value = "";

    }

 

})();

 

 

You didn't say what you want the result to be if the checkbox is unchecked, so the code sets it to an empty string. If you don't want to set the export value of the checkbox to 5 for some reason, that one line could be changed to:

 

        event.value = v1 * 5;


Viewing all articles
Browse latest Browse all 85594

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>