i am trying to help a friend on a program on client side scripting using javascript.
i have the following code but i am not getting the output desired.
<html>
<head>
<Script language="JavaScript">
var usernameVal;
if(document.f1.usernameVal.value.length<3)
{
alert("username is invalid")
return false;
}
else
{
alert("acceptable")
}
</script>
</head>
<body>
<form name="f1" method="post">
Username:
<input type="text" name=user value="">
<input type="submit" value="submit">
</form>
</body>
</html>
can somebody please modify this code and help me get a simple basic solution.i am not sure about form name f1, how to get value to usernameVal and then the post and submit. i have tried everywhere on net but in vain.I know basic javascript but not the client side scripting.