+ Start a Discussion
nimbusprojectnimbusproject 

How do I get current value of select list using javascript

How would I get the value of the select list using javascript section in my visualforce page

 

<apex:selectList id="queryDurationSelect" value="{!FilterDateValues}" size="1">

<apex:selectOptions value="{!FilterItems}"/>

</apex:selectList>

 

  

getFilterDateValues just returns a String[] of the select list values

- Jason 

Best Answer chosen by Admin (Salesforce Developers) 
prageethprageeth
Your List:

<apex:selectList value="{!FilterDateValues}" size="1" onchange="doSomething(this.value);">

<apex:selectOptions value="{!FilterItems}"/>

</apex:selectList> 

 
 Javascript-

<script>

function doSomething(value){

alert(value);

}

</script>