<input type="text" size="1" onkeydown="size=value.length||1" onkeyup="onkeydown()" onkeypress="onkeydown()" onchange="onkeydown()">