Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sample combobox Lightning
<aura:application extends="force:slds">
<aura:attribute name="contactFields" type="Contact" default="{sobjectType:'Contact',Gender__c:'Male',Partner_Gender__c:'Female'}" />
<aura:attribute name="genderOptions" type="List" default="[{label:'Male',value:'Male'},{label:'Female',value:'Female'},{label:'Not Specified/Other',value:'Not Specified/Other'}]" />
<lightning:combobox name="applicantgender" label="Applicant Gender" value="{!v.contactFields.Gender__c}" placeholder="Select Gender" options="{! v.genderOptions }" />
<lightning:combobox name="partnergender" label="Partner Gender" value="{!v.contactFields.Partner_Gender__c}" placeholder="Select Gender" options="{! v.genderOptions }" />
Applicant Gender: {!v.contactFields.Gender__c}<br />
Partner Gender: {!v.contactFields.Partner_Gender__c}
</aura:application>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.