I'm assuming that you are using Alloy and in view you have proper objects with ids.
textfields
it's just simple array with references to all TextFields in view, so it's easier to attach event listener for all of them and check if every single one is empty. You can always reverse this condition and make your button visible only if all of them has value.
var textfields = [$.textfield01, $.textfield02]
function checkTextfield(event) {
if (this.value !== '') {
$.button.visible = true;
} else {
for (var i in textfields) {
if (textfields[i].value !== '') {
return;
}
}
$.button.visible = false;
}
}
for (var i in textfields) {
textfields[i].addEventListener('change', checkTextfield);
}