Robert Granlund
asked on
Radio button to clear other radio buttons
I have the following radio buttons. They are named "wave_min" and "wave_min_alt" I want to clear the radio button "wave_min" if a "wave_min_alt" radio button is pressed and vise versa
<!-- START Wavelength -->
<div class="form-control main title">
<br />Wavelength
</div>
<!-- START Wavelength Search -->
<div class="form-control">
<input type="radio" name="wave_min" id="any" value="any">
<label for="any">
Any
</label>
</div>
<div class="form-control">
<input type="radio" name="wave_min" id="1100" value="1100">
<label for="1100">
Mid IR (Greater than 1100)
</label>
</div>
<div class="form-control">
<input type="radio" name="wave_min" id="9400" value="9400">
<label for="9400">
9400
</label>
</div>
<div class="form-control">
<input type="radio" name="wave_min" id="10600" value="10600">
<label for="10600">
10600
</label>
</div>
<div class="form-control">
<input type="radio" name="wave_min_alt" id="Fixed" value="Fixed">
<label for="Fixed">
Fixed
</label>
</div>
<div class="form-control">
<input type="radio" name="wave_min_alt" id="Factory Adjustable" value="Factory Adjustable">
<label for="Factory Adjustable">
Factory Adjustable
</label>
</div>
<div class="form-control">
<input type="radio" name="wave_min_alt" id="Tunable " value="Tunable ">
<label for="Tunable ">
Tunable
</label>
</div>
Why not name them all all wave_min?
ASKER
I think I just had a duhhhh moment. BUT there is a reason. I need to create two different variable for an AJAX call and need two different names.
Well maybe you don't since an unchecked radio button isn't going to send anything. If they are all unchecked, nothing will be sent. So if you use the second one to clear the first one, it will be the same effect as if they were all the same name.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.