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

onselect attribute is not working in apex:selectList
i write a visualforce page
<apex:page controller="sampleCon">
<apex:form>
<apex:selectList value="{!countries}" size="1" onselect="searchFeeds();">
<apex:selectOptions value="{!items}"/>
</apex:selectList>
<script type="text/javascript">
function searchFeeds(){
alert('Hello world');
}
</script>
<p/>
</apex:form>
<chatter:newsfeed />
</apex:page>
and controller code is
public class sampleCon {
String countries ;
public PageReference test() {
return null;
}
public List<SelectOption> getItems() {
List<SelectOption> options = new List<SelectOption>();
options.add(new SelectOption('US','US'));
options.add(new SelectOption('CANADA','Canada'));
options.add(new SelectOption('MEXICO','Mexico'));
return options;
}
public String getCountries() {
return countries;
}
public void setCountries(String countries) {
this.countries = countries;
}
}
when i select any different country from select list no alert is shown by the browser. can any one please point me why ??
try onchange, i.e.