This is my input field in the app
<div class="input-group input-group-sm mb-3 input-field col s6" role="alert">
<input id="input0" type="text" value = "<?= initialValue ?>" aria-label="Sizing example input" aria-describedby="inputGroup-sizing-sm" class="input-group-text validate">
</div>
Here is the js code for change the class of the input box's:
var initVal = document.getElementById('input0').value;
function money() {
google.script.run.withSuccessHandler(showValue).getNewValue();
}
document.getElementById('app').addEventListener('input', money);
document.getElementById('app').addEventListener('click', money);
document.getElementById('navigation').addEventListener('click', money);
if (initVal <= 0) {
document.getElementById('input0').classList.add('text-danger');
} else {
document.getElementById('input0').classList.add('text-success');
google.script.run.withSuccessHandler(showValue).getNewValue();
}
document.getElementById('input0').value = initVal;
function showValue(myValue) {
document.getElementById('input0').value = myValue;
}
But my problem is, the text color of the input0 remains the same. Please tell me what did I wrong?
And I have another issue. I want to disable the 'Add Customer' button when the initVal <= 0.
Please check all of the code here : https://github.com/Ashraful7679/USER-FORM-DataSource
And this is the Google sheet: https://docs.google.com/spreadsheets/d/1BhucrjhYGkkkT89djmTaeN5udkcTLcjRNJ83KJbKjic/edit?usp=sharing