I am trying to make a specific part of the form if one of the two specific radio buttons is set.
Here is the HTML for the switches:
<strong>Window:</strong><br> <input type="radio" name="wname" value="Hann" checked> Hann <input type="radio" name="wname" value="Hamming"> Hamming <input type="radio" name="wname" value="Bartlett"> Bartlett <input type="radio" name="wname" value="Rectangular"> Rectangular <input type="radio" name="wname" value="Kaiser"> Kaiser <input type="radio" name="wname" value="Dolph"> Dolph<p>
What I want, when the Kaiser or Dolph buttons are checked, this form appears:
<div class="wnum"> <strong>1. Window adjust parameter (-10 - 10):</strong><br> <select name="selectbox"> {% for i in range(-10,11): %} <option value="{{ i }}">{{ i }}</option> {% endfor %} </select><p> </div>
I tried so many many solutions that I lost a little here.
Here's what works great, but with only two switches :
HTML:
<input type=radio id="show" name="group"> <input checked type=radio id="hide" name="group"> <label id="id1" for="show"><span id="id1"> <div class="wnum"> <strong>1. Window adjust parameter (-10 - 10):</strong><br> <select name="selectbox"> {% for i in range(-10,11): %} <option value="{{ i }}">{{ i }}</option> {% endfor %} </select><p> </div> </span></label> <label id="id2" for="hide"><span id="id2"> <div class="wnum"> <strong>2. Window adjust parameter (-10 - 10):</strong><br> <select name="selectbox"> {% for i in range(-10,11): %} <option value="{{ i }}">{{ i }}</option> {% endfor %} </select><p> </div>
CSS:
input#show:checked ~ label#id1{ display:none; } input#show:checked ~ label#id2{ display:block; } input#hide:checked ~ label#id2{ display:none; } input#hide:checked ~ label#id1{ display:block; }
I'm just really stuck here, I'm trying to get it to work for at least 5 hours. So I wonder if there is a solution in CSS or possibly in Javascript, but I prefer only CSS.
There is no problem trying something with just a checkmark or two radio stations, but with these 6 radio stations.
So far I have tried these input[class="hiden-wnum"]:checked solutions, those input:not(:checked) + label#something solutions and two or three different Javascript solutions, but no one worked.