Click to See Complete Forum and Search --> : Enabling A Form Element
MikeysTown
07-10-2003, 03:38 PM
How Do You Enable A Disabled Form Element When An Action Takes Place?
e.g.:
There Is A "Create A Username And Password" Field That The Visitor Only Needs To Fill Out If They Choose To Join. These Elements Are Disabled. How Can I Enable Them Again If They Check The "Join Now" Check Box?
cacalex
07-10-2003, 03:50 PM
Why making it Disabled ???
Could'nt you make it invisible, an than make it visible if the user want to 'Join' ?
Use this :
STYLE="visibility:hidden"
STYLE="visibility:visible"
Charles
07-10-2003, 03:51 PM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Content-Script-Type" content="text/javascript">
<title>Example</title>
<style type="text/css">
<!--
label {display:block; margin:1em 0em}
-->
</style>
<form action="">
<div>
<label><input type="checkbox" onclick="if (this.checked) {this.form.name.onfocus = function () {}; this.form.pword.onfocus = function () {}} else {this.form.name.onfocus = function () {this.blur()}; this.form.pword.onfocus = function () {this.blur()}}">Join Now</label>
<label><input type="text" name="name" onfocus="this.blur()">Name</label>
<label><input type="password" name="pword" onfocus="this.blur()">Password</label>
<button type="submit">Submit</button>
</div>
</form>
MikeysTown
07-10-2003, 03:55 PM
Originally posted by cacalex
Why making it Disabled ???
Could'nt you make it invisible, an than make it visible if the user want to 'Join' ?
Use this :
STYLE="visibility:hidden"
STYLE="visibility:visible"
Explain This...
MikeysTown
07-10-2003, 04:09 PM
Originally posted by Charles
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Content-Script-Type" content="text/javascript">
<title>Example</title>
<style type="text/css">
<!--
label {display:block; margin:1em 0em}
-->
</style>
<form action="">
<div>
<label><input type="checkbox" onclick="if (this.checked) {this.form.name.onfocus = function () {}; this.form.pword.onfocus = function () {}} else {this.form.name.onfocus = function () {this.blur()}; this.form.pword.onfocus = function () {this.blur()}}">Join Now</label>
<label><input type="text" name="name" onfocus="this.blur()">Name</label>
<label><input type="password" name="pword" onfocus="this.blur()">Password</label>
<button type="submit">Submit</button>
</div>
</form>
Tell Me What I Need To Add, I Already Have The Form Done. I Don't Need The Skeleton (<HEAD>,<TITLE>,<BODY>)
Charles
07-10-2003, 04:09 PM
And explain how you are going to make the element visible for the 13% of users who do not use JavaScript.
MikeysTown
07-10-2003, 04:11 PM
Originally posted by Charles
And explain how you are going to make the element visible for the 13% of users who do not use JavaScript.
Oh Well For Them I Guess!
Charles
07-10-2003, 04:22 PM
That 13% includes people who cannot use JavaScript because of some disability. You'll note that the method I presented will keep the page working for those good folks.
cacalex
07-11-2003, 07:43 AM
Charles is right on this...
Making those elements invisible won't be of any help for that 13%...