in my form I have 4 radio button when i click one Radio button i want to be Uncheced Remaining three Radio buttons

in my form I have 4 radio button in JSF when i click one Radio button i want to be Uncheced Remaining three Radio buttons

Could you please give me a Pseudo code for that

Could you please correct my program
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>

<f:view>
<html>
	<head><title>Navigation Page</title></head>
	<body>
<script type="text/javascript"> 
 		
        
        function radioButton(radio) {
                alert("enter into javascript");
        
         document.getElementById("myform:radio1").checked = false; 
         document.getElementById("myform:radio2").checked = false;
         document.getElementById("myform:radio3").checked =false;
         
         radio.checked = false;
       }
        
	</script>
	
		<h:form>
		<link href="<%=request.getContextPath()%>/theme/main.css"
				type="text/css" rel="stylesheet">
<table width="100%" border="0" cellpadding="5" cellspacing="0">
  <tbody>
   <tr>
    <td class="txt">
     <table width="100%" border="0" cellpadding="5" cellspacing="0">
       <tbody>
        <tr valign="top" bgcolor="#ffffff">
          <td class="hblack" colspan="2" bgcolor="#ffffff">
            <table width="100%" border="0" cellpadding="0" cellspacing="0">
              <tbody>
                <tr>
                  <td bgcolor="#ccccff">
                    <table width="100%" border="0" cellpadding="5" cellspacing="1">
                      <tbody>
                        <tr>
                          <td class="txt" width="89%" bgcolor="#eeeeee">

                            <span class="hblack">Work with a Client 
                            </span>
                            <input name="flag" type="hidden">

                           </td>
                          </tr>
                         </tbody>
                        </table>
                       </td>
                      </tr>
                     </tbody>
                    </table>
                   </td>
                  </tr>
                   <tr valign="top" bgcolor="#ffffff">
                    <td class="txt" colspan="2" bgcolor="#ffffff">

                        Enter a client ID, CARE member ID or partial client name, then click Next. 

                    </td>
                   </tr>
                    <tr valign="top" bgcolor="#ffffff">
                      <td class="txt" colspan="2" bgcolor="#ffffff">
            
                        <table border="0" cellpadding="0" cellspacing="5">
                          <tbody><tr>
                            <td><h:selectOneRadio id="radio" onclick="radioButton(this)">
<f:selectItem  itemValue="Search by Client User ID"/>

</h:selectOneRadio></td>
                            <td class="hblack">Search by Client User ID </td>
                          </tr>
                           <tr>
                            <td>&nbsp;</td>
                            <td class="txt"><h:inputText id="name"
					value=""></h:inputText></td>
                           </tr>
                            <tr>
                              <td><h:selectOneRadio id="radio1">
<f:selectItem  itemValue="Search by CARE Member ID " />

</h:selectOneRadio></td>
                              <td class="hblack">Search by CARE Member ID </td>
                            </tr>
                             <tr>
                               <td>&nbsp;</td>
                               <td class="txt"><h:inputText id="CLIENTWISE_ID"
					value=""></h:inputText></td>
                            </tr>
                             <tr>
                               <td><h:selectOneRadio  id ="radio2">
<f:selectItem  itemValue="Find client profiles where client name contains " />

</h:selectOneRadio></td>
                               <td class="hblack">Find client profiles where client name contains </td>
                             </tr>
                              <tr>
                                <td>&nbsp;</td>
                               <td class="txt"><h:inputText id="ClientName"
					value=""></h:inputText></td>
                             </tr>
                              <tr>
                                <td><h:selectOneRadio id="radio3">
<f:selectItem  itemValue="Find client profiles where banker name contains " />

</h:selectOneRadio></td>
                                <td class="hblack">Find client profiles where banker name contains </td>
                             </tr>
                              <tr>
                                <td>&nbsp;</td>
                              <td class="txt"><h:inputText id="BankerName"
					value=""></h:inputText></td>
                             </tr>
                             
                             <tr>
                             <td> </td>
                                  <td class="hblack">Select By Client Type </td>
                             </tr>
                             <tr>
                             <td> </td>
                               <td>   <h:selectOneMenu id="SelectUserType"
			>
			<f:selectItem id="Client" itemLabel="Client"
				itemValue="Client" />
			<f:selectItem id="demo" itemLabel="demo"
				itemValue="demo" />
			<f:selectItem id="Survey" itemLabel="Survey" itemValue="Survey" />
		</h:selectOneMenu></td>
                             </tr>
                            </tbody></table>
                            
                          </td>
                         </tr>
                          <tr valign="top" bgcolor="#eeeeee">
                            <td class="txt">
                    
                            <h:commandButton value="Next" styleClass ="button" />
                            
                            
                              
                              
                     
                           </td>
                           
                            <td class="txt">
                    
                           <h:outputLink value="WorkWithAClient_AdvancedSearch.jsp"><h:outputText value="AdvancedSearch"/></h:outputLink>
                           
                              
                              
                     
                           </td>
                            <td class="txt" align="right">
                    
                        
                            </td>
                             <td class="txt" align="right">
                    
                        
                            </td>
                            
                            <td class="txt" align="right">
                    
                        
                            </td>
                             <td class="txt" align="right">
                    
                        
                            </td>
                           </tr>
                          </tbody>
                         </table>
                        </td>
                       </tr>
                    
                       </tbody>
                      </table>
		
			
		</h:form>
	</body>
</html>
</f:view>

Open in new window

LVL 9
Manikandan ThiagarajanSenior consultantAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Manikandan ThiagarajanSenior consultantAuthor Commented:
mbonaci:

that is myquestion only

i have found the answer with h:datatable radio button

i want ordinary form with table it would contians 4 h select radio buttons
0
mbonaciCommented:
Aha, you're JS guy, sorry.

Call something like this from radio onClick event (i haven't tested it):
function clearAllButMe(myself){
    var radios = document.getElementsByTagName('input');

    for(var i = 0; i < radios.length; i++){
        if(radios[i].getAttribute('type') == 'radio' && radios[i].getAttribute('name') != myself.getAttribute('name') )
            radios[i].checked = false;
    }
}

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java EE

From novice to tech pro — start learning today.