Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #41392

Re: four-state checkbox?

Path csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Arno Welzel <usenet@arnowelzel.de>
Newsgroups comp.lang.javascript
Subject Re: four-state checkbox?
Date Sun, 6 Aug 2023 13:47:56 +0200
Lines 34
Message-ID <kj9fjbFkf52U2@mid.individual.net> (permalink)
References <37b72956-7171-4f6a-baf5-0bcdb2e151b5n@googlegroups.com> <kj6t23F83ojU1@mid.individual.net> <uam12e$1qlch$5@dont-email.me>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 7bit
X-Trace individual.net 3oA5YKOEgT9prHtRnorO0wRfYghRqnz6itNB2jThC5orptqPzz
Cancel-Lock sha1:ySj0kpFfXPfHQUpKYJ5ezWEbdfM= sha256:LrFomnprd7mJdB9FMLd/0Wy87fzwhFvRdlU/jLexkYQ=
Content-Language de-DE
In-Reply-To <uam12e$1qlch$5@dont-email.me>
Xref csiph.com comp.lang.javascript:41392

Show key headers only | View raw


The Natural Philosopher, 2023-08-05 19:31:

> On 05/08/2023 13:19, Arno Welzel wrote:
>> luserdroog, 2023-08-03 17:04:
>>
>>> I want to make a control that looks like a checkbox but cycles through
>>> 4 states: { blank, checkmark, X-mark, questionmark }. What's the best
[...]
>>> Is there an existing element that's closer, like an <option> I guess?
>>
>> No. You need to implement it on your own or check if Angular, React, Vue
>> or Bootstrap have a component for that.
>>
> It's not hard to do in Javascript, simply have an onmousedown() event 
> that rotates an internal variable round 4 states and updates an onscreen 
> area with text, or selects e.g. a pseudo LED to light up to indicate the 
> state of the control.

If the OP would be able to do so, he would not have asked here.

> I have long since given up using any HTML input controls. They look like 
> shit and they are hard to get looking nice across browser variations.
> 
> CSS styles the whole thing and javascript handles all user input. And 
> ajax calls update the server.

And all this is *not* accessible. HTML input controls can be styled
*and* you can override them with your own components. But not using them
at all is often a very bad decision.

-- 
Arno Welzel
https://arnowelzel.de

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

four-state checkbox? luserdroog <luser.droog@gmail.com> - 2023-08-03 08:04 -0700
  Re: four-state checkbox? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2023-08-03 14:46 -0700
  Re: four-state checkbox? Arno Welzel <usenet@arnowelzel.de> - 2023-08-05 14:19 +0200
    Re: four-state checkbox? The Natural Philosopher <tnp@invalid.invalid> - 2023-08-05 18:31 +0100
      Re: four-state checkbox? Arno Welzel <usenet@arnowelzel.de> - 2023-08-06 13:47 +0200
  Re: four-state checkbox? luserdroog <luser.droog@gmail.com> - 2023-08-05 05:55 -0700
    Re: four-state checkbox? Arno Welzel <usenet@arnowelzel.de> - 2023-08-06 13:50 +0200
    Re: four-state checkbox? JJ <jj4public@outlook.com> - 2023-08-07 12:04 +0700
      Re: four-state checkbox? luserdroog <luser.droog@gmail.com> - 2023-08-07 07:56 -0700

csiph-web