multiple input validation javaScript