i have problem with passing multiselect picklist value to controller, and i want to insert it to picklist(multiselect) field. what should i do to achieve this ?
here's my visualforce
<apex:inputHidden value="{!banks}" id="banksId"/>
<select multiple="multiple" onchange="document.getElementById('{!$Component.banksId}').value = this.value;">
<option value="Standard Chartered;" >Standard Chartered</option>
<option value="ANZ;">ANZ</option>
<option value="DBS;">DBS</option>
<option value="UOB;">UOB</option>
</select>
here's my apex class
public PageReference Submit(){
public String[] banks{get;set;}
public String banks2SF{get;set;}
public PageReference Submit(){
if(banks.size()>0){
for(Integer i=0;i<banks.size();i++){
banks2SF +=banks[i]+';';
}
}
web2lead.List_of_Bank__c = banks2SF;
update web2lead;
}
it didn't store the any values, List_of_Bank__c is picklist(multiselect) and it only accept string not an array string. i need use html <select>
tag not <apex:SelectList>.