Added required validation and some little issues about min and maxlength checkings