function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
VFVF 

Radio buttons

I have To Radio Buttons and two textboxes placed beside them.As shown:  
<apex:panelGrid id="panelgrid" columns="2" > 
                             <apex:selectradio id="replyTo1" value="{!ReplyTo}" onclick="ReplyToField(this);" >                                            <apex:selectOption itemValue="replyToEmail"></apex:selectOption>                        
                             </apex:selectradio>
                             <apex:inputtext id="txt1" value="{!ownerEmail}" size="30"/><br/>
 
                             <apex:selectradio id="contactEmail" value="{!ContactEmail}">
                                  <apex:selectOption itemValue="cntEmail" ></apex:selectOption>
                             </apex:selectradio>
                             <apex:inputtext id="txt2" value="{!contact.Email}" size="30"/>
                         </apex:panelGrid>
 
When i click on the Radio button i want the Textbox value displayed beside it in apex code.
How can i check which Radio button is clicked in the server side(Apex controller) and get the text box value of the Radio  button clicked.
 
Or is there any other way to do so.as i dont have any idea on Radio Buttons. 
 
 Thanks
shaan 
 

 
 
 
 
sforce2009sforce2009
<apex:smileytongue:anelGrid id="panelgrid" columns="2" > 
                             <apex:selectradio id="replyTo1" value="{!ReplyTo}" onclick="ReplyToField(this);" >                                            <apex:selectOption itemValue="replyToEmail"></apex:selectOption>  
                        <apex:actionSupport event="onChange"  action="{!renderFirstLabel}" rerender="thisPageBlock"/>
                             </apex:selectradio>
                          <apex:outputLabel value="{!ownerEmail}" rendered="{!showFirlstLabel}"/>
 
                             <apex:inputtext id="txt1" value="{!ownerEmail}" size="30"/><br/>
                    in the class
                       You make the showFirstLabel property which is boolean as true in the action function renderFirstLabel.
Edwin VijayEdwin Vijay

<apex:selectradio id="replyTo1" value="{!ReplyTo}" onclick="ReplyToField(this);" > 

 

You would have defined get and set methods for the function  {!ReplyTo}  like Public String replyto {get;set;} .....

 

That's it... now the value that is selected is stored in the variable replyto... so if you say

 

<apex:inputtext value="{!Replyto}" > you would get the selected radio value... But i could see that you have two selectradio, why not make them into one if possible!!!

 

 

VineetzVineetz

OutOftopic : Lol @ the smiley :D