...

View Full Version : problem with onBlur



xiaodao
12-15-2007, 05:48 AM
Hi,please help, i am always getting "object expected"



<HTML>
<HEAD>

<link rel="stylesheet" href="style.css" type="text/css">

<script language="text/javascript">

function checkuser(){
alert("haha");
}
</script>

</HEAD>
<body bgcolor=#B6DF52 leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>
<center>

<div style="text-align:center;padding-top:30px;padding-bottom:30px;">
<form class="cssform" name="registration" method="post" action="register.php">
<p>
<label for="user">Username</label>
<input type="text" name="username" value="" class="highlight" onBlur="checkuser()"/><span id="checkusername"></span>
</p>
<p>
<label for="user">Password</label>
<input type="password" id="userpass" value="" />
</p>

<p>
<label for="comments">Contact Number:</label>
<input type="text" id="contact" value="" />
</p>

<div style="margin-left: 120px;">
<input type="submit" value="Submit" name="submit" /> <input type="reset" value="Reset" />
</div>

</form>


</div>

</body>
</html>

abduraooft
12-15-2007, 06:41 AM
<script language="text/javascript">

function checkuser(){
alert("haha");
}
</script>
Change to

<script type="text/javascript">

function checkuser(){
alert("haha");
}
</script>
Use a proper Doctype to your document and use lowercase for tags(html, head)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum