javascript code
<script type="javascript">
function validateName()
{
var username= document.register.registerUsername;
if (username != "")
{
document.getElementById("submit").disabled = false;
}
}
</script>
html code
<div align="center" class="register">
<h3>Register</h3>
<form action="!register.php" method="post" name="register">
<table width="300px">
<tr>
<td>Username:</td>
<td><input type="text" name="registerUsername" id="registerUsername" onchange="validateName()" onblur="validateName()" /></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" name="registerPassword" id="registerPassword" onchange="validatePassword()" onblur="validatePassword()" /></td>
</tr>
<tr>
<td>Repeat Password:</td>
<td><input type="password" name="registerPassword2" id="registerPassword2" onchange="validatePassword2()" onblur="validatePassword2()" /></td>
</tr>
<tr>
<td>Email:</td>
<td><input type="text" name="registerEmail" id="registerEmail" onchange="validateEmail()" onblur="validateEmail()" /></td>
</tr>
<tr>
<td>Repeat Email:</td>
<td><input type="text" name="registerEmail2" id="registerEmail2" onchange="validateEmail2()" onblur="validateEmail2()" /></td>
</tr>
<tr>
<td></td><td><input type="submit" id="submit" value="Register" name="register" disabled="disable"/></td>
</tr>
</table>
</form>