6 Replies Latest reply on Aug 17, 2011 6:23 PM by loki-dog

    if/else Script Needed If Checkbox is Selected

    tricia.helton Level 1

      I'm new at scripting so bear with me!     

       

      I have a checkbox group (state resident) with two selections available:  Yes or No

       

      If the customer/user selects "yes" to being a state resident, I need the text field (SalesTax) after the checkbox group to calculate the subtotal (text field) x sales tax (7.85%).  I know how to run the calculation for figuring the sales tax, but only want this to run if the customer/user selects "yes" to being a state resident.

       

      Here is my script for the calulation for SalesTax.

      //Get first field value, as a number
      var v1 = +getField("SubtotalOrder").value;

      //Calculate and set this field's value to the result
      event.value = .0785 * v1

       

      Thanks!!!