fixing validasi signer
This commit is contained in:
@ -55,14 +55,16 @@
|
||||
<div class="form-group row">
|
||||
<label for="inputName" class="col-sm-4 col-form-label">Deputy Director</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control form-control-sm " name="deputy_director" placeholder="Nama Deputy Director" style="text-transform:uppercase">
|
||||
<input type="text" class="form-control form-control-sm " id="deputy_director" name="deputy_director" placeholder="Nama Deputy Director" >
|
||||
<span class="noteDir" style="color:darkred;display:none" ><small>Nama Hanya Boleh Huruf.. !</small></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="inputName" class="col-sm-4 col-form-label">Executive Officer</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control form-control-sm " name="executive_officer" placeholder="Nama Executive Officer" id="executive_officer" style="text-transform:uppercase">
|
||||
<span id="note" style="color:darkred;display:none" ><small>Nama Tidak Boleh Sama .. !</small></span>
|
||||
<input type="text" class="form-control form-control-sm " id="executive_officer" name="executive_officer" placeholder="Nama Executive Officer" id="executive_officer" >
|
||||
<span class="note" style="color:darkred;display:none" ><small>Nama Tidak Boleh Sama .. !</small></span>
|
||||
<span class="noteEx" style="color:darkred;display:none" ><small>Nama Hanya Boleh Huruf.. !</small></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
@ -105,15 +107,17 @@
|
||||
<div class="form-group row">
|
||||
<label for="inputName" class="col-sm-4 col-form-label">Deputy Director</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="hidden" class="form-control form-control-sm " name="id" placeholder="Nama Deputy Director">
|
||||
<input type="text" class="form-control form-control-sm " name="deputy_director" placeholder="Nama Deputy Director" style="text-transform:uppercase">
|
||||
<input type="hidden" class="form-control form-control-sm " name="id" placeholder="Nama Deputy Director">
|
||||
<input type="text" class="form-control form-control-sm " name="deputy_director" placeholder="Nama Deputy Director" style="">
|
||||
<span class="noteDir" style="color:darkred;display:none" ><small>Nama Hanya Boleh Huruf.. !</small></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="inputName" class="col-sm-4 col-form-label">Executive Officer</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control form-control-sm " id="executive_officer2" name="executive_officer" placeholder="Nama Executive Officer" style="text-transform:uppercase">
|
||||
<span id="note2" style="color:darkred;display:none" ><small>Nama Tidak Boleh Sama .. !</small></span>
|
||||
<input type="text" class="form-control form-control-sm " id="executive_officer2" name="executive_officer" placeholder="Nama Executive Officer" style="">
|
||||
<span class="note" style="color:darkred;display:none" ><small>Nama Tidak Boleh Sama .. !</small></span>
|
||||
<span class="noteEx" style="color:darkred;display:none" ><small>Nama Hanya Boleh Huruf.. !</small></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
@ -148,34 +152,95 @@
|
||||
$("#myModalEditSigner").modal("hide");
|
||||
});
|
||||
|
||||
$('#executive_officer').on('keyup', function() {
|
||||
let deputy_eirector = $('input[name="deputy_director"]').val();
|
||||
let executive_officer = $(this).val();
|
||||
if (executive_officer == deputy_eirector ) {
|
||||
// alert('Penandatangan Tidak Boleh Sama');
|
||||
$('#executive_officer').css('border-color', 'red');
|
||||
$('#submitSigner').attr('disabled', 'disabled');
|
||||
$('#note').show();
|
||||
}else{
|
||||
$('#executive_officer').css('border-color', '');
|
||||
$('#submitSigner').attr('disabled', false);
|
||||
$('#note').hide();
|
||||
}
|
||||
});
|
||||
// $('#executive_officer').on('keyup', function() {
|
||||
// let deputy_eirector = $('input[name="deputy_director"]').val();
|
||||
// let executive_officer = $(this).val();
|
||||
// var value = $(this).val();
|
||||
// // var valid = /^[A-Za-z ]+$/.test(value);
|
||||
|
||||
$('#executive_officer2').on('keyup', function() {
|
||||
let deputy_eirector = $('input[name="deputy_director"]').val().toUpperCase();
|
||||
let executive_officer = $(this).val();
|
||||
if (executive_officer == deputy_eirector ) {
|
||||
$('#executive_officer2').css('border-color', 'red');
|
||||
$('#submitFormUpdateSigner').attr('disabled', 'disabled');
|
||||
$('#note2').show();
|
||||
}else{
|
||||
$('#executive_officer2').css('border-color', '');
|
||||
$('#submitFormUpdateSigner').attr('disabled', false);
|
||||
$('#note2').hide();
|
||||
}
|
||||
});
|
||||
// // if (!valid) {
|
||||
// // $(this).css('border-color', 'red'); // Ubah warna border menjadi merah jika input tidak valid
|
||||
// // $('#submitSigner, #submitFormUpdateSigner').prop('disabled', true); // Non-aktifkan tombol submit
|
||||
// // alert('Input hanya boleh berisi huruf.');
|
||||
// // } else {
|
||||
// // $(this).css('border-color', ''); // Kembalikan warna border
|
||||
// // $('#submitSigner, #submitFormUpdateSigner').prop('disabled', false); // Aktifkan tombol submit
|
||||
// // }
|
||||
// if (executive_officer == deputy_eirector ) {
|
||||
// // alert('Penandatangan Tidak Boleh Sama');
|
||||
// $('#executive_officer').css('border-color', 'red');
|
||||
// $('#submitSigner').attr('disabled', 'disabled');
|
||||
// $('#note').show();
|
||||
// }else{
|
||||
// $('#executive_officer').css('border-color', '');
|
||||
// $('#submitSigner').attr('disabled', false);
|
||||
// $('#note').hide();
|
||||
// }
|
||||
// });
|
||||
|
||||
// $('#executive_officer2').on('keyup', function() {
|
||||
// let deputy_eirector = $('input[name="deputy_director"]').val().toUpperCase();
|
||||
// let executive_officer = $(this).val();
|
||||
// if (executive_officer == deputy_eirector ) {
|
||||
// $('#executive_officer2').css('border-color', 'red');
|
||||
// $('#submitFormUpdateSigner').attr('disabled', 'disabled');
|
||||
// $('#note2').show();
|
||||
// }else{
|
||||
// $('#executive_officer2').css('border-color', '');
|
||||
// $('#submitFormUpdateSigner').attr('disabled', false);
|
||||
// $('#note2').hide();
|
||||
// }
|
||||
// });
|
||||
|
||||
|
||||
$('input[name="deputy_director"]').on('input', function() {
|
||||
let executive_officer = $('input[name="executive_officer"]').val();
|
||||
var deputy_eirector = $(this).val();
|
||||
var valid = /^[A-Za-z ]+$/.test(deputy_eirector);
|
||||
|
||||
if (!valid) {
|
||||
$(this).css('border-color', 'red'); // Ubah warna border menjadi merah jika input tidak valid
|
||||
$('#submitSigner, #submitFormUpdateSigner').prop('disabled', true); // Non-aktifkan tombol submit
|
||||
$('#deputy_director').css('border-color', 'red');
|
||||
$('.noteDir').show();
|
||||
// alert('Input hanya boleh berisi huruf.');
|
||||
} else {
|
||||
$(this).css('border-color', ''); // Kembalikan warna border
|
||||
$('#submitSigner, #submitFormUpdateSigner').prop('disabled', false); // Aktifkan tombol submit
|
||||
$('.noteDir').hide();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$('input[name="executive_officer"]').on('input', function() {
|
||||
let deputy_eirector = $('input[name="deputy_director"]').val();
|
||||
var executive_officer = $(this).val();
|
||||
var valid = /^[A-Za-z ]+$/.test(executive_officer);
|
||||
|
||||
if (!valid) {
|
||||
$(this).css('border-color', 'red'); // Ubah warna border menjadi merah jika input tidak valid
|
||||
$('#submitSigner, #submitFormUpdateSigner').prop('disabled', true); // Non-aktifkan tombol submit
|
||||
$('#executive_officer').css('border-color', 'red');
|
||||
$('.noteEx').show();
|
||||
// alert('Input hanya boleh berisi huruf.');
|
||||
} else {
|
||||
$(this).css('border-color', ''); // Kembalikan warna border
|
||||
$('#submitSigner, #submitFormUpdateSigner').prop('disabled', false); // Aktifkan tombol submit
|
||||
$('.noteEx').hide();
|
||||
}
|
||||
|
||||
if (executive_officer == deputy_eirector ) {
|
||||
// alert('Penandatangan Tidak Boleh Sama');
|
||||
$('#executive_officer').css('border-color', 'red');
|
||||
$('#submitSigner').attr('disabled', 'disabled');
|
||||
$('.note').show();
|
||||
}else{
|
||||
$('#executive_officer').css('border-color', '');
|
||||
$('#submitSigner').attr('disabled', false);
|
||||
$('.note').hide();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// Handle form submission when the "Submit" button inside the modal is clicked
|
||||
$("#submitSigner").click(function(e) {
|
||||
|
Reference in New Issue
Block a user