Jupac
07-22-2003, 08:43 PM
Can some one help me with this script it is used to check if the username is taken or not.
<html>
<head>
<script>
function MsgBox(e) {alert(e)}
function cuname(){
var check="0"
if (form1.text1.value != "username1"){check="1";}
if (form1.text1.value != "username2"){check="1";}
if (check=="0") {MsgBox(form1.text1.value) is not taken is ok to use as username}
if (check=="1") {MsgBox(form1.text1.value) is taken try a diffrent Username}
}
</script>
</head>
<body>
<form onsubmit="cuname()" name="form1">
<input Name="text1" value="">
<input type="submit" name="submit" value="try">
</form>
</body>
</html>
<html>
<head>
<script>
function MsgBox(e) {alert(e)}
function cuname(){
var check="0"
if (form1.text1.value != "username1"){check="1";}
if (form1.text1.value != "username2"){check="1";}
if (check=="0") {MsgBox(form1.text1.value) is not taken is ok to use as username}
if (check=="1") {MsgBox(form1.text1.value) is taken try a diffrent Username}
}
</script>
</head>
<body>
<form onsubmit="cuname()" name="form1">
<input Name="text1" value="">
<input type="submit" name="submit" value="try">
</form>
</body>
</html>