Changed js input error handling and its test