{% extends 'index.html' %} {% block content %} {% load static %}
<div class="oh-wrapper">
  <form action="" class="mt-5" method="post" enctype="multipart/form-data" >
    {% csrf_token %} {{form.as_p}}
    <input
      type="submit"
      value="Save"
      class="oh-btn oh-btn--secondary mt-2 mr-0 oh-btn--w-100-resp"
    >
</form>
<script>
  $(document).ready(function () {
    function toggleFunction() {
      if($("#id_calculate_daily_leave_amount").is(":checked")){
        $("#id_deduction_for_one_leave_amount,[for=id_deduction_for_one_leave_amount]").hide();
      }
      else{
        $("#id_deduction_for_one_leave_amount,[for=id_deduction_for_one_leave_amount]").show();

      }
    }
    $("[type=checkbox]").change(function (e) {
      e.preventDefault();
      toggleFunction()
    });
    toggleFunction()

  });
</script>
</div>
{% endblock content %}
