function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
NerdyNerdy 

Implement multiple choice questions in a lightning form

Hi folks,
I am new to lightninf and i have a requirement.
I need to Implement multiple choice questions in a lightning form and bind the choosen values with a field in salesforce
suppose the field is "Question" (Api name question__c) and possible answers are op1,op2,op3,op4
Can you correct this part and tell me how can i bind tthe answers with the field ? I want to have multiple checkboxes
<h4>Question</h4>
                        <div class="slds-grid slds-wrap"> 
                            <div class="slds-grid slds-wrap">
                                <div class="slds-col slds-size_1-of-2">
                                    <lightning:input type="checkbox" label="Op1" name="type1" value="{!v.question__c"/>
                                </div>
                                <div class="slds-col slds-size_1-of-2">
                                    <lightning:input type="checkbox" label="Op2" name="type2" value="{!v.question__c}"/>
                                </div>
                                <div class="slds-col slds-size_1-of-2">
                                    <lightning:input type="checkbox" label="Op3" name="type3" value="{!v.question__c}"/>
                                </div>
                                <div class="slds-col slds-size_1-of-2">
                                    <lightning:input type="checkbox" label="Op4" name="type4" value="{!v.question__c}"/>
                                </div>
                                
                            </div>
                        </div>