Create validator.java

performs validation in form input