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


Groups > comp.lang.javascript > #41389

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 Sat, 5 Aug 2023 14:19:15 +0200
Lines 25
Message-ID <kj6t23F83ojU1@mid.individual.net> (permalink)
References <37b72956-7171-4f6a-baf5-0bcdb2e151b5n@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 7bit
X-Trace individual.net u29tFmpD4s2EJxygYEpKbg+pyKx7wD/6pDhSbGgYMnW1NDrVmr
Cancel-Lock sha1:ud/AXFTOlPOQ0gkH1BatxAjeK7M= sha256:cb/xUsaEfpUjEw/P3zhtBIzHcIwgrRats+c2AFJJxA4=
Content-Language de-DE
In-Reply-To <37b72956-7171-4f6a-baf5-0bcdb2e151b5n@googlegroups.com>
Xref csiph.com comp.lang.javascript:41389

Show key headers only | View raw


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

A *checkbox* is there to show a *checked* or *unchecked* state.

If you need 4 different states, then it is not a checkbox but just some
element which shows 4 states. And in most cases a radio group is much
better for this - then users can clearly see what options are available
and can choose one of the options.

> way to build such a thing. I'm thinking it wouldn't be too hard to make
> a web component that just controls a span and flips through
> { "&nbsp;", "&#x...whatevers", ... "?" } strings.
> 
> 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.

-- 
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