add employee Validation
This commit is contained in:
@@ -69,17 +69,17 @@
|
||||
</div>
|
||||
<div class="right col-lg-4 col-md-6 col-sm-6 col-xs-12">
|
||||
<div id="divMarried" class="form-group flexible-div oblig2">
|
||||
<div class="radio-box">
|
||||
<label class="radio-label">وضعیت تاهل <span style="color: red;">*</span></label>
|
||||
<div class="radio-input">
|
||||
<label>
|
||||
متاهل<input type="radio" value="متاهل" asp-for="MaritalStatus" name="MaritalStatus">
|
||||
</label>
|
||||
<label>
|
||||
مجرد<input type="radio" value="مجرد" asp-for="MaritalStatus" name="MaritalStatus">
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="radio-box">
|
||||
<label class="radio-label">وضعیت تاهل <span style="color: red;">*</span></label>
|
||||
<div class="radio-input">
|
||||
<label>
|
||||
متاهل<input type="radio" value="متاهل" asp-for="MaritalStatus" name="MaritalStatus">
|
||||
</label>
|
||||
<label>
|
||||
مجرد<input type="radio" value="مجرد" asp-for="MaritalStatus" name="MaritalStatus">
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="right col-lg-3 col-md-6 col-sm-6 col-xs-12">
|
||||
@@ -545,36 +545,35 @@
|
||||
}
|
||||
|
||||
var birthday = $('#iniDateOfBirth').val();
|
||||
var codeMelli = $('#iniCodeMelli').val();
|
||||
var codeMelli = $('#iniCodeMelli').val();
|
||||
|
||||
try {
|
||||
const response = await $.ajax({
|
||||
url: loadUidInfo,
|
||||
url: loadUidInfo,
|
||||
method: 'POST',
|
||||
data: { nationalCode: codeMelli, birthDate: birthday },
|
||||
headers: { "RequestVerificationToken": antiForgeryToken }
|
||||
data: { nationalCode: codeMelli, birthDate: birthday },
|
||||
headers: { "RequestVerificationToken": antiForgeryToken }
|
||||
});
|
||||
|
||||
console.log(response);
|
||||
if (response.success) {
|
||||
if (response.success) {
|
||||
$('#IsAuthorized').val(true);
|
||||
$('#name').val(response.data.fName);
|
||||
$('#family').val(response.data.lName);
|
||||
$('#FatherName').val(response.data.fatherName);
|
||||
$('#DateOfBirth').val(response.data.birthDate);
|
||||
$('#code-melli').val(response.data.nationalCode);
|
||||
$('#FatherName').val(response.data.fatherName);
|
||||
$('#DateOfBirth').val(response.data.birthDate);
|
||||
$('#code-melli').val(response.data.nationalCode);
|
||||
$('#IdNumber').val(response.data.idNumber);
|
||||
$('#IdNumberSerial').val(response.data.idNumberSerial);
|
||||
$('#IdNumberSeri').val(response.data.idNumberSeri);
|
||||
$('#IdNumberSerial').val(response.data.idNumberSerial);
|
||||
$('#IdNumberSeri').val(response.data.idNumberSeri);
|
||||
if (response.data.gender === 0) {
|
||||
$('#GenderMale').prop('checked', true);
|
||||
} else if (response.data.gender === 1) {
|
||||
$('#GenderFemale').prop('checked', true);
|
||||
}
|
||||
} else {
|
||||
$.Notification.autoHideNotify('error', 'top right', 'خطا', response.message);
|
||||
return;
|
||||
}
|
||||
$.Notification.autoHideNotify('error', 'top right', 'خطا', response.message);
|
||||
return;
|
||||
}
|
||||
|
||||
currentStep++;
|
||||
showStep(currentStep);
|
||||
@@ -582,6 +581,30 @@
|
||||
$.Notification.autoHideNotify('error', 'top right', 'خطا', "ارسال اطلاعات با مشکل مواجه شد.");
|
||||
return;
|
||||
}
|
||||
} else if (currentStep === 1) {
|
||||
|
||||
if ($(".form1 #divGender").find('input[type="radio"]:checked').length === 0) {
|
||||
$.Notification.autoHideNotify('error', 'top right', 'خطا', "لطفا جنسیت را مشخص نمایید.");
|
||||
$(".form1 #divGender").addClass('errored');
|
||||
|
||||
setTimeout(function () {
|
||||
$(".form1 #divGender").removeClass('errored');
|
||||
}, 2500);
|
||||
return;
|
||||
}
|
||||
|
||||
if ($(".form1 #divMarried").find('input[type="radio"]:checked').length === 0) {
|
||||
$.Notification.autoHideNotify('error', 'top right', 'خطا', "لطفا وضعیت تاهل را مشخص نمایید.");
|
||||
$(".form1 #divMarried").addClass('errored');
|
||||
|
||||
setTimeout(function () {
|
||||
$(".form1 #divMarried").removeClass('errored');
|
||||
}, 2500);
|
||||
return;
|
||||
}
|
||||
|
||||
currentStep++;
|
||||
showStep(currentStep);
|
||||
} else {
|
||||
if (validateStep(currentStep)) {
|
||||
if (currentStep < steps.length - 1) {
|
||||
|
||||
@@ -566,12 +566,26 @@
|
||||
$(".listNext").click(function() {
|
||||
if ($("#divGender").find('input[type="radio"]:checked').length === 0) {
|
||||
// allInputsFilled = false;
|
||||
$.Notification.autoHideNotify('error', 'top right', 'خطا', "لطفا جنسیت را مشخص نمایید.");
|
||||
$("#divGender").addClass('errored');
|
||||
|
||||
setTimeout(function () {
|
||||
$("#divGender").removeClass('errored');
|
||||
}, 2500);
|
||||
return;
|
||||
}
|
||||
|
||||
if ($("#divMarried").find('input[type="radio"]:checked').length === 0) {
|
||||
// allInputsFilled = false;
|
||||
// $("#divMarried").addClass('errored');
|
||||
|
||||
$.Notification.autoHideNotify('error', 'top right', 'خطا', "لطفا وضعیت تاهل را مشخص نمایید.");
|
||||
$("#divMarried").addClass('errored');
|
||||
|
||||
setTimeout(function () {
|
||||
$("#divMarried").removeClass('errored');
|
||||
}, 2500);
|
||||
return;
|
||||
}
|
||||
|
||||
const option1 = document.getElementById("city").options.selectedIndex;
|
||||
|
||||
Reference in New Issue
Block a user