JavaScript to enable "submit" button (doesn't work)
Posted
by Halst
on Stack Overflow
See other posts from Stack Overflow
or by Halst
Published on 2010-03-17T23:14:38Z
Indexed on
2010/03/17
23:21 UTC
Read the original article
Hit count: 147
JavaScript
I need the button "submit" to be disabled unless JavaScript is on.
I tried:
1.
<input onLoad="this.disabled=false" id="post-comment" type="submit"
value="Post Your Comment" disabled="disabled"/>
2.
<input onLoad="this.removeAttribute("disabled");" id="post-comment" type="submit"
value="Post Your Comment" disabled="disabled"/>
3.
<input onLoad="document.getElementById("post-comment").removeAttribute("disabled");"
id="post-comment" type="submit" value="Post Your Comment" disabled="disabled"/>
Doesn't work. I'm new to JavaScript, but can't find answer on the net.
© Stack Overflow or respective owner