Update script.js

Added code for checking correctly filled inputs.