Add an "onblur" event to the input field that will run some javascript that with check it.
<input type="text" name="qs" value="" onblur="CheckField(this)">
Then have javascript check the length of the field
function CheckField(obj) {
if (obj.value.length <= '3') {
alert('Name field must be more than 3 character long');
obj.focus();
}
}
Now that is bit rough on the user as once they click the field they can not get off it till they have more than 3 characters in the field. But hopefully it gives you a place to start.
Also you could add an "onsubmit" event to the <form> tag and have that check the field. And to keep it from submitting you would just use a "return false" in the "if" statement, in place of the "obj.focus()".