var form = document.getElementById('some-form');
var button = document.getElementById('submit-button');
var inputs = form.getElementsByTagName('input');
button.addEventListener('click', function(e) {
for(var i=0; i < inputs.length; i++) {
var input = inputs[i];
if(!input.value)
e.preventDefault();
}
});