[thelist] Toggle disable/enable of text box

Joshua OIson joshua at alphashop.net
Thu Jan 18 10:00:31 CST 2001


Try this:

<form>
<input type=checkbox onclick="test.disabled =this.checked; return true;">
<input name="test" value="Enter text here">
</form>

Often times (jeff can explain better) you have to return true from an event
to make is effects activate.

-joshua

----- Original Message -----
From: "Miller, Bart" <MillerB at bek.com>
To: <thelist at lists.evolt.org>
Sent: Thursday, January 18, 2001 6:01 AM
Subject: [thelist] Toggle disable/enable of text box


> I have a form where I want to disable an input box if a checkbox is
checked
> (see code below).  Now, it works fine when I check the box.  But when I
> uncheck the box it does not become enabled again.  I only need this to
work
> in IE5+ browsers.  Is this a bug?
>
> <form>
> <input type=checkbox onclick="if (this.checked) {test.disabled = 'true'}
> else {test.disabled='false'}">
> <input name="test" value="Enter text here">
> </form>
>
> ---------------------------------------
> For unsubscribe and other options, including
> the Tip Harvester and archive of TheList go to:
> http://lists.evolt.org Workers of the Web, evolt !





More information about the thelist mailing list