Update script2.js

Removed an unnecessary loop that was checking all the inputs on submit (that is done onchange).