Merged in bugfix/blockEnterarosV2 (pull request #347)
add block enter after add new customer
This commit is contained in:
@@ -87,7 +87,7 @@
|
|||||||
<h5 class="modal-title" id="ModalLabel">Daftar Pelanggan</h5>
|
<h5 class="modal-title" id="ModalLabel">Daftar Pelanggan</h5>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<form action="{{ route('customer.store') }}" onsubmit="verifycustomer()" method="POST">
|
<form name="form-store" action="{{ route('customer.store') }}" onsubmit="verifycustomer()" method="POST">
|
||||||
@csrf
|
@csrf
|
||||||
<div class="row form-group">
|
<div class="row form-group">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
@@ -358,7 +358,7 @@
|
|||||||
<h5 class="modal-title" id="ModalLabel">Daftar Pelanggan</h5>
|
<h5 class="modal-title" id="ModalLabel">Daftar Pelanggan</h5>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<form action="{{ route('customer.store') }}" onsubmit="verifycustomerpassport()" method="POST">
|
<form name="form-store" action="{{ route('customer.store') }}" onsubmit="verifycustomerpassport()" method="POST">
|
||||||
@csrf
|
@csrf
|
||||||
<div class="row form-group">
|
<div class="row form-group">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
@@ -1346,6 +1346,21 @@
|
|||||||
$('#pekerjaan-lain').val('');
|
$('#pekerjaan-lain').val('');
|
||||||
lainContainer.hide();
|
lainContainer.hide();
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
document.getElementsByName('form-store')[0].addEventListener('keypress', function(e) {
|
||||||
|
// Jika tekan Enter
|
||||||
|
if (e.key === 'Enter') {
|
||||||
|
|
||||||
|
// Jika bukan butang submit dan bukan textarea
|
||||||
|
const tag = e.target.tagName.toLowerCase();
|
||||||
|
const type = e.target.type ? e.target.type.toLowerCase() : '';
|
||||||
|
|
||||||
|
if (tag !== 'textarea' && type !== 'submit') {
|
||||||
|
e.preventDefault();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@push('additional_scripts')
|
@push('additional_scripts')
|
||||||
|
|||||||
Reference in New Issue
Block a user