to better explain the scenario here is what i am d...
# javascript
s
to better explain the scenario here is what i am doing
Copy code
document.addEventListener('readystatechange', function(e) {
        switch (e.target.readyState) {
            case "complete":
                
                $('.totalsTeal').trigger('input');
            break;
        }
    });

$(document).on('input', '.totalsTeal', function() {
        let self = $(this);
        let day = self.attr('data-name');
        console.log(self.val());
        if (self.val() === "0.00") {
            $('#w1_' + day).parent().find('label').css('display', 'none');
        } else {
            $('#w1_' + day).parent().find('label').css('display', 'block');
        }
    });
so everytime, the value entered in the input field will have the updated value in the input field having a class of .totalsTeal and it should fire, the class is common to 3 or 4 inputs and every input works like a row
m
What does your html look like?
You'd need to fire the event for the 2nd input whenever you update it from another function, since it's readonly, input, change events won't ever be fired.
s
i can remove readonly, the issue stays the same, unles it actually touches that 2nd input on events like pointerout, change, input it does not fire
m
When are you expecting input to fire?
When/after typing in the field?
s
it fires only when i change thevalue of 2nd input but i want to have them fired when the first input value is changed 2nd should fire automatically even when it does get any control
so in first field i enter 8 , it updates the value in 2nd input as 8, so as soon as it gets 8 in 2nd field, it should fire the event
m
I don't think input works that way, when it's updated via js. I think you'd have to actual input something into the field directly to fire the input event. Otherwise, if you want an event to fire when you update the 2nd element via js, you have to call the function.
m
Here is a stackoverflow article that might help you with firing the change events on the other inputs if you programtically change them... https://stackoverflow.com/questions/16250464/trigger-change-event-when-the-input-value-changed-programmatically
1