I wrote a very simple validating script and I can't see what am I missing it just won't run at all
<title>Untitled Document</title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<SCRIPT type "text/JavaScript">
(function checkform(){
var user = document.getElementById('user').value;
if (user.lenght<5)
{
$("#username_error").html("Please enter a Username");
return false;
}
else
{return true}
})
(function checkuser(){
var user = document.getElementById('user').value;
var element = document.getElementById('username_error');
if (user.lenght<5)
{
element.innerHTML ="Please Enter a valid Username";
} else
{ element.innerHTML ="Username is valid";
}
})
</SCRIPT>
</head>
<body>
<form onsubmit='checkform();'>
<input type="text" id="user" onblur='checkuser();' />
<input type="submit" value="submit"/>
<div id="username_error">div</div></form>
</body>
</html>