I guess size of input is the size of the input box, if am I right, not the length of the text. Have you looked at the original code, is there perhaps a check already ? The ask a question has a check for size of input text, check that out and see how it is done.
Jörgen