app-test-verify-form.js 623 B

1234567891011121314151617181920212223
  1. class TestVerifyForm {
  2. constructor() {
  3. this.$invoiceAmountField = $("#invoice-amount");
  4. this.$newTestProjectField = $("#new-test-project-id");
  5. this.$newTestProjectField.on("change", event => {
  6. const $option = this.$newTestProjectField.find("option:selected");
  7. const customerFee = $option.attr("data-customer-fee");
  8. this.$invoiceAmountField.val(customerFee);
  9. });
  10. this.$paymentRequiredField = $("#payment-required");
  11. this.$paymentRequiredField.on("change", event => {
  12. $("#invoice-amount").closest(".row").prop("hidden", !event.currentTarget.checked);
  13. });
  14. }
  15. }
  16. $(() => new TestVerifyForm());