I Suck at JavaScript!

I Suck at JavaScript!

sprinkles

Chrome Whore
2009 Sep 6 • 2547
10 ₧
I can't even enable a button!

:/
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>
 
 
 
2010 Dec 6 at 06:42 UTC — Ed. 2010 Dec 6 at 06:44 UTC
SuperJer
Websiteman

2005 Mar 21 • 6666
You probably want:

javascript code
document.register.registerUsername.value
 
 
 
2010 Dec 6 at 07:47 UTC
Rockbomb
Dog fucker (but in a good way now)

2009 Nov 14 • 2045
Just get rid of the
code
disabled="disable"
from the button
 
 
 
2010 Dec 6 at 16:25 UTC
phoenix_r

2009 May 13 • 905
17 ₧
In Soviet Russia, JavaScript sucks at YOU!
BOO
 
 
 
2010 Dec 6 at 20:12 UTC
sprinkles

Chrome Whore
2009 Sep 6 • 2547
10 ₧
Superjer is right.
 
 
 
2010 Dec 6 at 20:46 UTC
Rockbomb
Dog fucker (but in a good way now)

2009 Nov 14 • 2045
sprinkles said:
Superjer is right.

So am I. I saved your page, did what I said, and the button worked fine
 
 
 
2010 Dec 6 at 20:54 UTC
phoenix_r

2009 May 13 • 905
17 ₧

Nobody fucks with the SuperJesus.
BOO
 
 
 
2010 Dec 6 at 22:55 UTC
Rockbomb
Dog fucker (but in a good way now)

2009 Nov 14 • 2045
phoenix_r said:

Nobody fucks with the SuperJesus.

A challenger appears
 
 
 
2010 Dec 6 at 23:15 UTC
phoenix_r

2009 May 13 • 905
17 ₧
I need to redo that pic now that I have more than 5 minutes...turrible...
BOO
 
 
 
2010 Dec 7 at 01:18 UTC
Page [1]