You need to sign in to do that
Don't have an account?
Bablu Kumar Pandit
make a text box appear on selection of a Radio Button in vf page
i tried to control using java script but not work please guide me
Below see my code
Below see my code
<apex:selectRadio value="{!Ques1}" layout="pageDirection" id="Ques1" onchange="check(this)"> <apex:selectOption itemLabel="Extremely Satisfied" itemValue="Extremely Satisfied"/> <apex:selectOption itemLabel="Very Satisfied" itemValue="Very Satisfied"/> <apex:selectOption itemLabel="Neither satisfied nor dissatisfied" itemValue="Neither satisfied nor dissatisfied"/> <apex:selectOption itemLabel="Somewhat dissatisfied" itemValue="Somewhat dissatisfied"/> <apex:selectOption itemLabel="Very dissatisfied" itemValue="Very dissatisfied"/> </apex:selectRadio> -------JavaScript----- <script type="text/javascript"> function check(Selected){ var choice = Selected.value; if(choice == "Neither satisfied nor dissatisfied" || choice == "Somewhat dissatisfied" || choice == "Very dissatisfied" ){ //alert('if'); document.getElementsById("msg")[0].style.display = "block" }else{ //alert('else'); document.getElementsById"msg")[0].style.display = "none" } } </script>
<apex:inputField> example
VF Page
Controller Extension
<apex:inputText> example
You can do this with jquery as well. Try it yourself
If you find this information helpful, please mark this answer as Best. It may help others in the community. Thank You!
Anudeep