added maxlength detection
added required attr detection