<form class="row g-3 auto-width" action="{{ route('accounting-types.update', $type->id)}}" method="post" enctype='multipart/form-data'>
    @csrf
    @method('patch')
    <div class="col-md-12">
        <label for="name" class="form-label">Type Name <span class="text-danger"><b>*</b></span></label>
        <input type="text" class="form-control" id="name" name="name" aria-describedby="inputGroupPrepend" required value="{{$type->name}}">
        <span class="text-danger error_name" style="display:none;">This field is required.</span>
    </div>
    <div class="col-md-6">
        <label for="code" class="form-label">Code</label>
        <input type="text" class="form-control" id="code" name="code" aria-describedby="inputGroupPrepend" required value="{{$type->code}}">
        <span class="text-danger error_code" style="display:none;">This field is required.</span>
    </div>
    <div class="col-md-6">
        <label for="if_increase" class="form-label">If Increase</label>
        <input type="text" class="form-control" id="if_increase" name="if_increase" aria-describedby="inputGroupPrepend" required value="{{$type->if_increase}}">
        <span class="text-danger error_if_increase" style="display:none;">This field is required.</span>
    </div>
    <div class="col-md-6">
        <label for="if_decrease" class="form-label">If Decrease</label>
        <input type="text" class="form-control" id="if_decrease" name="if_decrease" aria-describedby="inputGroupPrepend" required value="{{$type->if_decrease}}">
        <span class="text-danger error_if_decrease" style="display:none;">This field is required.</span>
    </div>
    <div class="col-md-6">
        <label for="priority" class="form-label">Priority</label>
        <input type="text" class="form-control" id="priority" name="priority" aria-describedby="inputGroupPrepend" required value="{{$type->priority}}">
        <span class="text-danger error_priority" style="display:none;">This field is required.</span>
    </div>
</form>
<script type="text/javascript">
      $("#priority").on('input', function() {
          const onlyNumbers = $(this).val().replace(/[^0-9]/g, '');
          $("#priority").val(onlyNumbers);
      });
</script>