Added support for elements with maxlength