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 5 at 22:42 PST — Ed. 2010 Dec 5 at 22:44 PST
SuperJer
Websiteman

2005 Mar 20 • 6201
You probably want:

javascript code
document.register.registerUsername.value
 
 
2010 Dec 5 at 23:47 PST
Rockbomb
Dog fucker (but in a good way now)

2009 Nov 13 • 2045
Just get rid of the
code
disabled="disable"
from the button
 
 
2010 Dec 6 at 08:25 PST
phoenix_r

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

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

2009 Nov 13 • 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 12:54 PST
phoenix_r

2009 May 13 • 898
17 ₧

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

2009 Nov 13 • 2045
phoenix_r said:

Nobody fucks with the SuperJesus.

A challenger appears
 
 
2010 Dec 6 at 15:15 PST
phoenix_r

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