<form class="form">
<input type="text" name="username" />
<input type="text" name="password" />
<input type="submit" value="Войти" disabled />
</form>
$('form').on('input', function() {
const disabled = $('[type="text"]', this).get().some(n => n.value.length < 5);
$('[type="submit"]', this).prop({ disabled });
});
document.querySelector('form').addEventListener('input', e => {
e.currentTarget.querySelector('[type="submit"]').disabled = Array
.from(e.currentTarget.querySelectorAll('[type="text"]'))
.some(n => n.value.length < 5);
});