Skip to content

Instantly share code, notes, and snippets.

@tyoshikawa1106
Created October 13, 2015 17:52
Show Gist options
  • Save tyoshikawa1106/0543a20a56f89b59e0df to your computer and use it in GitHub Desktop.
Save tyoshikawa1106/0543a20a56f89b59e0df to your computer and use it in GitHub Desktop.
複数選択リスト値取得
<apex:page standardController="Account" showHeader="true" sidebar="false" id="page">
<apex:form>
<apex:pageBlock mode="edit" id="block">
<apex:pageBlockSection title="ApexTable" columns="1">
<apex:inputField value="{!Account.MultiPicklistField__c}" onchange="return changePick();" id="pickFields"/>
<script>
function changePick() {
var options = document.getElementById('{!$Component.pickFields}').options;
for(var i = 0; i < options.length; i++){
console.log(options[i].value + ' : ' + options[i].selected);
};
return false;
}
</script>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment