You need to sign in to do that
Don't have an account?

How to create a picklist for a survey using visualforce
Hi all,
I'm using VisualForce for an intake survey. The first part of it is relatively easy. This is the code for First Name.
<apex:inputfield value="{!Contact.FirstName}" />
However, I can't find any guidance on how to ask a yes or no question in the intake. I would want to limit it to yes or no. Not allow anything else like "working on it" or "almost."
Anyone know of a possible answer?
I'm using VisualForce for an intake survey. The first part of it is relatively easy. This is the code for First Name.
<apex:inputfield value="{!Contact.FirstName}" />
However, I can't find any guidance on how to ask a yes or no question in the intake. I would want to limit it to yes or no. Not allow anything else like "working on it" or "almost."
Anyone know of a possible answer?
I have tested this code , it working 100% correct Please use:-
Please MARK AS BEST ANSWER!!!!!!!
Regards
Mukesh
All Answers
You have to use apex:selectRadio visualforce compoent to capture yes or no radio option.
Please go through https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_selectRadio.htm.
You can perform action based on selection with change event of component.
Please mark this as best answer if this helps to you.
Hi Abiud,
Please creeate Select Option in vf page, and create a getter setter method in controller to populate option value. Here is the sample link (https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_selectOption.htm)
Hope this helps !!!
Thanks,
Gaurav
Skype: gaurav62990
I have tested this code , it working 100% correct Please use:-
Please MARK AS BEST ANSWER!!!!!!!
Regards
Mukesh