Cast value to string when input has maxlength option