Radio button to clear other radio buttons

Robert Granlund
Robert Granlund used Ask the Experts™
on
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>

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Why not name them all all wave_min?

Author

Commented:
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.
Dave BaldwinFixer of Problems
Most Valuable Expert 2014

Commented:
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.
IT Expert
Top Expert 2009
Commented:
Give them the same name but a different id or data attribute and Bob's your uncle

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial