Update application2.js

user input validation