Fixed the JavaScript form validation logic from isValid && validateXxx() to validateXxx() && isValid, in order to correctly validate multiple fields at once.
This commit is contained in:
parent
62b59e7380
commit
a0382ad179
@ -97,8 +97,8 @@ function updateParent(code) {
|
|||||||
*/
|
*/
|
||||||
function validateForm() {
|
function validateForm() {
|
||||||
let isValid = true;
|
let isValid = true;
|
||||||
isValid = isValid && validateCode();
|
isValid = validateCode() && isValid;
|
||||||
isValid = isValid && validateTitle();
|
isValid = validateTitle() && isValid;
|
||||||
return isValid;
|
return isValid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -338,26 +338,26 @@ function resetRecordButtons() {
|
|||||||
*/
|
*/
|
||||||
function validateForm() {
|
function validateForm() {
|
||||||
let isValid = true;
|
let isValid = true;
|
||||||
isValid = isValid && validateDate();
|
isValid = validateDate() && isValid;
|
||||||
$(".debit-record").each(function () {
|
$(".debit-record").each(function () {
|
||||||
isValid = isValid && validateRecord(this);
|
isValid = validateRecord(this) && isValid;
|
||||||
});
|
});
|
||||||
$(".credit-account").each(function () {
|
$(".credit-account").each(function () {
|
||||||
isValid = isValid && validateRecord(this);
|
isValid = validateRecord(this) && isValid;
|
||||||
});
|
});
|
||||||
$(".record-account").each(function () {
|
$(".record-account").each(function () {
|
||||||
isValid = isValid && validateAccount(this);
|
isValid = validateAccount(this) && isValid;
|
||||||
});
|
});
|
||||||
$(".record-summary").each(function () {
|
$(".record-summary").each(function () {
|
||||||
isValid = isValid && validateSummary(this);
|
isValid = validateSummary(this) && isValid;
|
||||||
});
|
});
|
||||||
$(".record-amount").each(function () {
|
$(".record-amount").each(function () {
|
||||||
isValid = isValid && validateAmount(this);
|
isValid = validateAmount(this) && isValid;
|
||||||
});
|
});
|
||||||
if (isTransfer()) {
|
if (isTransfer()) {
|
||||||
isValid = isValid && validateBalance();
|
isValid = validateBalance() && isValid;
|
||||||
}
|
}
|
||||||
isValid = isValid && validateNote();
|
isValid = validateNote() && isValid;
|
||||||
return isValid;
|
return isValid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user