You need to sign in to do that
Don't have an account?
Option value in inside of JS in Pageload
My code:
Class:
public class Jserrors{
public list<Selectoption> Performance{set; get;}
public Jserrors(){
Performance = pick();
}
public list<SelectOption> pick(){
op.add(new selectOption('Prospect','Prospect');
op.add(new selectOption('Customer-Direct','Customer-Direct');
op.add(new selectOption('Other','Other');
return op;
}
}
VF code:
<apex:page controller="Jserrors">
<apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" />
<script>
$(function($) {
$('.Radios').each(function(){
var value = $(this).val();
alert('value'+value);
});
});
</script>
<apex:form >
<div>
<div style = "margin-bottom:10px;">Radios</div>
<div>
<apex:selectRadio layout="pageDirection" id = "radios" styleClass="Radios">
<apex:selectOptions value="{!Performance}"></apex:selectOptions>
</apex:selectRadio>
</div>
</div>
</apex:form>
</apex:page>
In mycode have returned empty option value in page load.Is it possible to return Performance option values in page load?
Better!
Here you are
(Salesforce renders the radios and applies class a lil diffrerent way.)
All Answers
What due you mean by "return Performance option values in page load" ?
Yes.I Need all three radio option(Performance option values) values in page load.
My output is showing in alerts(3 times alerts).
value Prospect
value Customer-Direct
value Other
But Still not clear!
what exactly you want ?
do you want them in one alert or something ?
Avi, In page load, I want to get this all radio button option values in alerts.I have three selectoption values in controller.Now In script function i got the only one empty alert.But I want to get three option values in each alert by one by one in Script.Is it possibl?
Better!
Here you are
(Salesforce renders the radios and applies class a lil diffrerent way.)
Hai Avi,
In that above code, How to check I didn't select any select radio(throws error via alert ""please select any one option") in that options? Is it possible?