validate user inputs via javascript