<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<script language="JavaScript">
<!---//hide
function check(n,t)
{
if(t.value.length >= n)
alert(t.value)
//alert(document.forms[0].elements[t].value)
}
--->
</script></head>
<body>
<input type="Text" onkeyup="check(2,this)"><br>
<input type="Text" onkeyup="check(5,this)">
</body></html>