Note that there are some explanatory texts on larger screens.

plurals
  1. POClicking on label doesn't check radio button
    primarykey
    data
    text
    <p>I'm trying to make a color picker by setting up html like this:</p> <pre><code>&lt;ol class="kleurenkiezer list-reset clearfix"&gt; &lt;li&gt; &lt;input type="radio" id="kleur_wit" name="kleurenkiezer" value="wit"&gt; &lt;label for="kleur_wit" style="background: white;"&gt;&lt;/label&gt; &lt;/li&gt; &lt;li&gt; &lt;input type="radio" id="kleur_creme" name="kleurenkiezer" value="creme"&gt; &lt;label for="kleur_creme" style="background: #fffceb;"&gt;&lt;/label&gt; &lt;/li&gt; &lt;li&gt; &lt;input type="radio" id="kleur_lichtbruin" name="kleurenkiezer" value="lichtbruin"&gt; &lt;label for="kleur_lichtbruin" style="background: #968272;"&gt;&lt;/label&gt; &lt;/li&gt; &lt;li&gt; &lt;input type="radio" id="kleur_bordeauxrood" name="kleurenkiezer" value="bordeauxrood"&gt; &lt;label for="kleur_bordeauxrood" style="background: #941514;"&gt;&lt;/label&gt; &lt;/li&gt; &lt;li&gt; &lt;input type="radio" id="kleur_oudgroen" name="kleurenkiezer" value="oudgroen"&gt; &lt;label for="kleur_oudgroen" style="background: #7fa298;"&gt;&lt;/label&gt; &lt;/li&gt; &lt;li&gt; &lt;input type="radio" id="kleur_lichtblauw" name="kleurenkiezer" value="lichtblauw"&gt; &lt;label for="kleur_lichtblauw" style="background: #487eae;"&gt;&lt;/label&gt; &lt;/li&gt; &lt;li&gt; &lt;input type="radio" id="kleur_oudgeel" name="kleurenkiezer" value="oudgeel"&gt; &lt;label for="kleur_oudgeel" style="background: #b79130;"&gt;&lt;/label&gt; &lt;/li&gt; &lt;li&gt; &lt;input type="radio" id="kleur_zwart" name="kleurenkiezer" value="zwart"&gt; &lt;label for="kleur_zwart" style="background: #000;"&gt;&lt;/label&gt; &lt;/li&gt; &lt;/ol&gt; </code></pre> <p>What I'm trying to do is make the actual radio button invisible to the user and make the label clickable so that I have a neat list of colored squares that you can select one of. Now my radio button doesn't seem to get checked.. Why would that be?</p> <p>My css:</p> <pre><code>.kleurenkiezer { width: 165px; margin-left: -10px; float: right; } .kleurenkiezer li { position: relative; width: 45px; height: 45px; margin: 0 0 10px 10px; border: 1px solid #bbbbbb; float: left; } .kleurenkiezer li input { position: absolute; top: 10px; left: 10px; z-index: 1000; } .kleurenkiezer li label { position: absolute; top: 0; left: 0; width: 43px; height: 43px; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload