I have a text field for which I wrote add error methods like it can be only numeric and cannot be less than 5 characters.. Is there anyway that I could display error messages as soon as user starts typing in the text field.
(You could also choose to do it by using Visualforce's partial page refresh mechanism but in my experience this is so slow that it just confuses your users.)
If you were lucky enough to only have to support very modern browsers you can make use of the HTML5 input pattern feature (see e.g. http://html5pattern.com/). You can specify this in Visualforce by prefixing the attribute with "html-".
PS If you want to do a lot of jQuery form validation you might also choose to use the jQuery Validation Plugin; Wes Nolte has a blog post Salesforce Form Validation Enhanced about using this with Visualforce.