Retard-3000
05-29-2008, 02:46 PM
Hey, i dont know wether this is javascript or not but i was wondering what code would i use to check whether a text input field had more than 3 characters and less then 10. i thought about using variables but dont know how, this is initially how i tried it.
<html>
<head>
<title>Javascript</title>
<script type="text/javascript">
function usercheck()
if(text1 <somethingtosaylessthen3characters)
{
alert("Your Username Must Be More Than 3 Characters Long");
}
else if(<somethingtosaylessthen10characters)
{
alert("Thank You")
}
</script>
</head>
<body>
<input type="text" name="text1"><input type="button" value="Check" onclick="usercheck()">
</body>
</html>
i dont know how to explain it any better but any help is appreciated thanks
<html>
<head>
<title>Javascript</title>
<script type="text/javascript">
function usercheck()
if(text1 <somethingtosaylessthen3characters)
{
alert("Your Username Must Be More Than 3 Characters Long");
}
else if(<somethingtosaylessthen10characters)
{
alert("Thank You")
}
</script>
</head>
<body>
<input type="text" name="text1"><input type="button" value="Check" onclick="usercheck()">
</body>
</html>
i dont know how to explain it any better but any help is appreciated thanks