I have a web form and I want to resize a text area into one-row height if the input content exceeds more than one line. I have a function to do this already that gets triggered on input, change, events.
JS code
$('.autoresizing').on('input change', function () {
this.style.height = 'auto';
this.style.height = (this.scrollHeight) + 'px';
});
CSS code
#autoresizing {
display: block;
overflow: hidden;
resize: none;
}
I trigger the form reset event on form inputs to clear the input values after successful data save. Is there any event that gets triggered on the form inputs, textareas when the parent form triggers reset?