Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Disabling text box with a radio button

0 views
Skip to first unread message

Thierry Blanchard

unread,
Aug 31, 1998, 3:00:00 AM8/31/98
to
Let's say I have 2 text boxes and 2 radio buttons.
Is it possible to disable one text box when the user selects a radio button
?

Thanks,
Thierry.

Alan J. Flavell

unread,
Aug 31, 1998, 3:00:00 AM8/31/98
to
On Mon, 31 Aug 1998, Thierry Blanchard wrote:

> Let's say I have 2 text boxes and 2 radio buttons.
> Is it possible to disable one text box when the user selects a radio button

With HTML? No.

With client-side scripting: probably, but users can turn scripting off,
so you better be sure that you're not relying on that when you evaluate
the forms submission.

Say, if you only want one text box to be usable, why have two of them?
Perhaps if you'd tell people what it is you aim to achieve, instead
of presenting a half-formed solution to an unstated problem, someone
might be able to offer a better suggestion.

(f'ups narrowed)


Diane Wilson

unread,
Aug 31, 1998, 3:00:00 AM8/31/98
to

In article <6seglt$9i4$1...@platane.wanadoo.fr>, "Thierry Blanchard" <tblan...@sevenww.co.uk> writes:
|> Let's say I have 2 text boxes and 2 radio buttons.
|> Is it possible to disable one text box when the user selects a radio button

Within a single form, with HTML only, no.

If you are creating a multi-page form, you can put the radio buttons
on a page prior to the text boxes. The CGI script that receives data from
the first page and generates the second page can tailor the set of input
widgets in any way that it wants.

It does make your CGI programming much more interesting, however.

To answer Alan's question, why have two text fields in the first place,
the answer is that it depends on the application. The alternative
radio button may require use of both text fields. Radio buttons might
tell you that you want to change the prompt text for one or both fields.
Use of the field may change. It depends.
--
Diane Wilson | All their brains are in their heads,
dewi...@pobox.com | where brains ought to be. No one sits
http://www.lava.net/~dewilson/ | beside their brain. No one but me.
http://www.acm.org/chapters/trichi/ |

Alan J. Flavell

unread,
Sep 1, 1998, 3:00:00 AM9/1/98
to
On 31 Aug 1998, Diane Wilson wrote:

> To answer Alan's question, why have two text fields in the first place,
> the answer is that it depends on the application.

Sure it does. In case it wasn't clear, I was inviting the original
poster to ask themselves the question, and/or reveal a little more about
the underlying problem. It wsn't that I was short of possible answers
myself ;-}

> Use of the field may change. It depends.

Indeed it does. If I gave the impression that it was otherwise, then
let me correct that impression. Thanks.

0 new messages