How to do Validation using "name"
Here is Loan auto calc script.
https://jsfiddle.net/diessses/Lpaqnoue/
I have a question about Validation. I could error check using "id = xxx". but I changed code as "name = xxx". Could you teach me how to write code using "name = xxx" please?
function showError(error) {
document.getElementById('results').style.display = 'none';
document.getElementById('loading').style.display = 'none';
const errorDiv = document.createElement('div');
const card = document.querySelector('.card');
const heading = document.querySelector('.heading');
errorDiv.className = 'alert alert-danger';
card.insertBefore(errorDiv, heading);
setTimeout(clearError, 300);
}
And also I would like to do validation at "cb_amount" Input field.
'cb_amount' value must like this
'cb_amount' =< ('amount' - 'downpayment') / 2
I would like to add this at showError function.