You need to sign in to do that
Don't have an account?
Easier option than selectradio or selectlist?
I'm creating a survey, and want to have respondents answer picklist questions using radio buttons.
I can do this using the standard selectradio, selectoptions approach.
But this requires me to specify the values of the options anew for every question. With 40 questions that's a lot of coding, although it can be simplified using maps. But before I dig into that ...
Is there an existing jquery or other pre-made javascript function which takes a salesforce picklist field and transforms it from its standard dropdown format into radio buttons, and includes all the values from the picklist field, without having to program those values into it using selectoptions?
Thanks in advance, Baird
No need to explictly build the list yourself:
Bind this function to a apex:selectOptions, and you're done. You can even have it dynamically choose the field(s) to obtain the picklists for, and, of course, changing the setup automatically updates your page's values.
Thanks, sfdcfox. That helps.