Input Name
Represents a name compound field. This component requires API version 42.0 and later.
Descriptor
lightning:inputNameTargets
Lightning Experience, Experience Builder Sites, Salesforce Mobile App, Lightning Out / Visualforce, Standalone Lightning App
Example Options
Basic Name FieldsName fields can have predefined values. Required Name FieldsWhen name fields are marked as required, a field-level error is thrown if Last Name is blank. Disabled Name FieldsDisabled name fields are grayed out and you cannot interact with them. Read-Only Name FieldsRead-only name fields are not editable. Name Fields with Field-Level HelpField-level help guides users with information about the name fields.
Basic Name Fields
Code
<aura:component> <aura:attribute name="salutationOptions" type="List" default="[ {'label': 'Mr.', 'value': 'Mr.'}, {'label': 'Ms.', 'value': 'Ms.'}, {'label': 'Mrs.', 'value': 'Mrs.'}, {'label': 'Dr.', 'value': 'Dr.'}, {'label': 'Prof.', 'value': 'Prof.'}, ]"/> <div> <lightning:inputName label="Default Input Name Field" firstName="John" middleName="Middleton" lastName="Doe" informalName="Jo" suffix="The 3rd" salutation="Mr." options="{!v.salutationOptions}" /> </div> </aura:component>