0

I am newbie in SalesForce Commerce Cloud. So if my question is silly then I am sorry in advance.

My Target is to show the multiselect on customer registration form. By searching on internet what I have done

Step 1: Add form definition

<field formid="brands" label="label.select.interestedbrands.preferences" type="integer" mandatory="true" binding="profile.interestedBrands">  
      <options>           
 <option optionid="1" label="Brand 1" value="1"/>

<option optionid="2" label="Brand 2" value="2" />

<option optionid="3" label="Brand 3" value="3" />  
<option optionid="4" label="Brand 4" value="4" />  
<option optionid="5" label="Brand 5" value="5" />            
<option optionid="6" label="Brand 6" value="6" />            
<option optionid="7" label="Brand 7" value="7" />        
</options>    
</field>

Step 2: In isml template file I have rendered it like this

<select class="custom-select form-control" id="brands" <isprint value="${pdict.preferencesForm.brands.attributes}" encoding="off" /> multiple>                    
<isloop items=${pdict.preferencesForm.brands.options} var="brand"> 
<option id="${brand.id}" value="${brand.htmlValue}" <isif condition="${brand.selected}">selected</isif> >${brand.label}</option>                  
  </isloop>               
 </select>

To save it in the system object profile I have added one new attribute which type is Enum of Integer and multiselect true.

Problem: Now when I try to save the form in the controller it have only one value whether I select multiple options or not.

Can you please let me know how can I add the multi-select in the SFCC and which mistake I am doing?

Abbas
  • 763
  • 1
  • 12
  • 26

0 Answers0