You need to sign in to do that
Don't have an account?
Ali Abdullatif
How to make an input feild appear upon selection of radio button?
Hello friends
I have 3 feilds in my form and I need to update only one of them based on a selection
the problem is I want to be able to click a bottun and have the corresponding input field appear or disappear
is there any way to do that?
I have 3 feilds in my form and I need to update only one of them based on a selection
the problem is I want to be able to click a bottun and have the corresponding input field appear or disappear
is there any way to do that?
<apex:form>
<apex:actionFunction name="rerenderBlock" action="{!debugLog}" reRender="pb"/>
<apex:outputPanel id="pb">
<apex:pageBlock >
<div>
<label>box1</label><apex:inputCheckbox value="{!box1}" onclick="rerenderBlock()"/>
<label>box2</label><apex:inputCheckbox value="{!box2}" onclick="rerenderBlock()"/>
<label>box3</label><apex:inputCheckbox value="{!box3}" onclick="rerenderBlock()"/>
</div>
<div>
<apex:pageBlockSection rendered="{!box1}">
<label>Input 1</label><apex:inputText value="{!input1}"/>
</apex:pageBlockSection>
<apex:pageBlockSection rendered="{!box2}">
<label>Input 2</label><apex:inputText value="{!input1}"/>
</apex:pageBlockSection>
<apex:pageBlockSection rendered="{!box3}">
<label>Input 3</label><apex:inputText value="{!input1}"/>
</apex:pageBlockSection>
</div>
</apex:pageBlock>
</apex:outputPanel>
</apex:form>
All Answers
<apex:form>
<apex:actionFunction name="rerenderBlock" action="{!debugLog}" reRender="pb"/>
<apex:outputPanel id="pb">
<apex:pageBlock >
<div>
<label>box1</label><apex:inputCheckbox value="{!box1}" onclick="rerenderBlock()"/>
<label>box2</label><apex:inputCheckbox value="{!box2}" onclick="rerenderBlock()"/>
<label>box3</label><apex:inputCheckbox value="{!box3}" onclick="rerenderBlock()"/>
</div>
<div>
<apex:pageBlockSection rendered="{!box1}">
<label>Input 1</label><apex:inputText value="{!input1}"/>
</apex:pageBlockSection>
<apex:pageBlockSection rendered="{!box2}">
<label>Input 2</label><apex:inputText value="{!input1}"/>
</apex:pageBlockSection>
<apex:pageBlockSection rendered="{!box3}">
<label>Input 3</label><apex:inputText value="{!input1}"/>
</apex:pageBlockSection>
</div>
</apex:pageBlock>
</apex:outputPanel>
</apex:form>