Sometimes we will face an issue to read the drop down values in java script function, then the below code may be use full.
Note :- In chrome browser onclick function will not work.
<aui:select name="selectvideo" id="selectvideo1" label="Select Video" onChange="getPrice()">
<aui:option value="-1" >
<liferay-ui:message key="select-video" />
</aui:option>
<script>
function getPrice() {
var sel = document.getElementById("<portlet:namespace/>selectvideo1");
document.getElementById("<portlet:namespace/>key").value = sel.options[sel.selectedIndex].value;
}
</script>
Note :- In chrome browser onclick function will not work.
<aui:select name="selectvideo" id="selectvideo1" label="Select Video" onChange="getPrice()">
<aui:option value="-1" >
<liferay-ui:message key="select-video" />
</aui:option>
<script>
function getPrice() {
var sel = document.getElementById("<portlet:namespace/>selectvideo1");
document.getElementById("<portlet:namespace/>key").value = sel.options[sel.selectedIndex].value;
}
</script>