Skip to main content

Questions tagged [lightning-inputfield]

A lightning:input component creates an HTML input element. This component supports HTML5 input types, including checkbox, date and datetime-local, email, file, password, search, tel, url, number, radio, toggle. The default is text.

Filter by
Sorted by
Tagged with
0 votes
1 answer
37 views

when i set null on lightning-input type="date" the variable is assigned as null but on date picker it still shows selected value

I have a requirement where i need to check two dates, basically if the Start Date is greater than End Date, i need to clear the current field that is being changed. For the first time it works fine, ...
Gustavo Fazilari's user avatar
0 votes
0 answers
17 views

lighting-input-field does not visualise default values for address compound field

It seems there is a bug where the default value of lightning-input-field for the address compound field is not visualized although the value is properly set. However, default values for other compound ...
Bozhidar Tyanev's user avatar
0 votes
0 answers
44 views

lightning:inputField type Lookup is not working properly on mobile

As I checked, Salesforce supported lightning:inputField type Lookup for Aura Component. After I used this item in my Aura Component. As a standard function when I click on lookup field, the drop down ...
Dung Rieu's user avatar
0 votes
1 answer
407 views

LWC Restrict <lightning-input> to number with max value

I have an input on an LWC which has to be a number and not greater than 2000. How do I go about achieving this, because whatever I've tried is not working. This is my input definition: <lightning-...
Irene's user avatar
  • 1,861
1 vote
1 answer
214 views

Is there a simple way to make a separate checkbox label clickable for a label-hidden lightning-input-field?

The goal here is to specify a long block of text in an LWC page for a form field rather than to use the field's label. I also want the label to stay clickable, particularly for checkbox fields to ...
Keith C's user avatar
  • 137k
0 votes
1 answer
87 views

Missing required picklist inputs not scrolled to when a lightning-record-edit-form is submitted (but text fields are)

My lightning-record-edit-form (running in a Digital Experience) scrolls to off the screen text fields that are required but not filled in when the submit button is clicked. But the scrolling doesn't ...
Keith C's user avatar
  • 137k
0 votes
0 answers
480 views

LWC, Is there a way to programmatically check if a lightning-input-field is in error?

I'm using lightning-record-edit-form and lightning-input-field so that I get entries fields that understand the basic metadata, like getting the picklists automatically and making fields required. ...
Ken's user avatar
  • 488
0 votes
1 answer
78 views

Check input email and suggest a correct domain if there typing mistake

There is a email lightning input. Let's say User will input a value for that as below. Ex1- [email protected] (gimail should correct by giving a suggestion as gmail) Ex2- [email protected](.co should ...
Buhuni's user avatar
  • 9
1 vote
2 answers
3k views

Email validation not working in LWC lightning-input

I have a lightning-input of type="email" to which I'm trying to add a pattern validation. I added regEx as below but it seems to be not working as expected. Html: <lightning-input name=&...
sfdcDev's user avatar
  • 77
1 vote
1 answer
563 views

Replicate border focus behavior lightning input

I'm using this repository because I needed a multi select combobox like this and works fine except the input is not a lightning-input so it doesn't have the blue border focus like this: https://...
Alexia's user avatar
  • 83
1 vote
1 answer
947 views

Is it possible to restrict picklist values for a lightning-input-field?

Currently, it seems that there is no way to remove some of the options for a picklist while using the lightning-input-field (in my case on the lightning-record-edit-form). The only solution I came up ...
Ivan Sudakov's user avatar
0 votes
1 answer
58 views

How can I get a specific Lightning:inputField cmp without change the aura:id

I have a component with 2 inputFields like this: <lightning:recordEditForm recordId="{!v.recordId}" aura:id="recordEditForm" objectApiName="Example__c" > <...
Tuấn Trần quốc's user avatar
1 vote
1 answer
2k views

Salesforce LWC edit form not showing input fields

I have poured through the articles and answers, tried updating the code base to some solutions based on those articles, checked FLS and Profile access to ensure proper access to the fields and I still ...
Finnster's user avatar
3 votes
0 answers
1k views

Lightning-input vs lightning-input-field

I am facing issues with using both Lightning-input and lightning-input-field. Some of my requirements are satisfied with Lightning-input and some with lightning-input-field.Here are issues faced. ...
CodeGirl's user avatar
0 votes
1 answer
2k views

Change label colour lightning-input LWC

Hello guys I am trying to change the label colour of a lightning-input in a Community that has a green default colour. I tried this approach: <lightning-combobox label="Item" class="...
TechGuy's user avatar
  • 117
0 votes
0 answers
252 views

Clear value after button clicked

I have three different lighting component: Lightning input rich text Lightning input search Lightning input file Lightning datatable After a button is clicked I want to delete all the values the ...
TechGuy's user avatar
  • 117
0 votes
1 answer
191 views

avoid deleting all files LWC

Hello I am working on a lightning-input field whose type is a file. In this component I want to allow the users to upload several files and show its name and an option to delete the selected file the ...
TechGuy's user avatar
  • 117
0 votes
2 answers
8k views

.querySelector return value from lightning-input-field based on field-name

I want to have a button on my LWC to validate the values of my lightning-input-field's and lightning-input fields. I am trying to return the value of my lightning-input-fields based on the field-name ...
Jeff Callahan's user avatar
0 votes
1 answer
221 views

lightning-input-field not showing only in package

I have a lightning record edit form which properly shows in my dev org, but when it's packaged, the lightning-input-fields no longer contain any html. I've confirmed that data is properly sent from ...
Chris's user avatar
  • 1
3 votes
2 answers
4k views

How can I change the background color of an input in a lwc?

When changing the background-color attribute of a <lightning-input this also changes the label's background. Inspecting the input I found a class called .slds-input which allows you to change the ...
Sean's user avatar
  • 51
0 votes
1 answer
714 views

Template Expression Doesn't allow for Computer Expression in lightning-input-field

I have been trying to iterate through and access some data that I'm getting from an apex call. I have a list of field IDs that I get from a field set something like this.positionFieldIds=['Name', 'Id',...
Kevin Yao's user avatar
  • 159
1 vote
1 answer
776 views

Show again a hide field LWC

Hello everybody I am working in a LWC trying to show and hide two fields when one is filled with data the other one is hided. And if this filled field is erased the other one appears. And vice versa. ...
user avatar
0 votes
1 answer
533 views

Populate input field with data LWC problems

Hello everybody I am currently working on a Flow that receives the Id from the record where the LWC action is and pass it to the LWC. The LWC is a form that shows some lightning-input and lightning-...
user avatar
0 votes
1 answer
306 views

Aura component replace highlighted text

Hi I want to be able to have the user highlight text in a lightning:inputRichText component and then be able to replace it with a link. I am able to get the highlighted text with window.getSelection()....
Toby's user avatar
  • 21
0 votes
1 answer
1k views

Align Vertically Combobox and Lightning Input

I need to align 4 inputs fields that are dynamically build (c-filter-component), they can be either of type combobox or of standard lightning input and maximum 4. The problem is I am unable to align ...
Juan Ge's user avatar
  • 13
0 votes
1 answer
4k views

How can I set the actual date as a min value to my lightning-input datepicker?

I am trying to set the actual date (today) as a minimum value to my date picker, using LWC. I can't make it work, as I get a component error message that "today is not defined". HTML <...
Klosmi's user avatar
  • 3
0 votes
1 answer
1k views

LWC input field tag, add custom values in standard picklist

In lightning-input-field, I am displaying Opportunity Stage field. My record type has 10 picklist values. I want to display only 5 picklist values. Is there a way we can set picklist options in the ...
Harshith Srinivas's user avatar
2 votes
1 answer
4k views

align lightning input inline label to the right

I've tried a few things and no matter what I do I cannot get the lightning inline label to align to the right instead of the left. I would like the First Name and Last Name label to align to the right ...
Ohmicron's user avatar
  • 707
1 vote
2 answers
7k views

How do I prevent checkbox being checked if user doesn't confirm the edit?

I have a lightning-input checkbox. When the user checks it, I show a confirm dialog. If the user confirms the edit, the checkbox should get checked and disabled. If the user cancels, however, the ...
Chuck's user avatar
  • 1,017
0 votes
1 answer
792 views

Clear value of lightning input field that is a rich text

I'm trying to reset form field values after submitting a form with lightning-record-edit-form but haven't been able to reset the rich text field. The HTML is this: <lightning-layout-item padding=&...
Fab's user avatar
  • 1
2 votes
1 answer
510 views

How to reset address search lightning:inputAddress when showAddressLookup="true"

I am using the lightning:inputAddress on an aura lightning component with showAddressLookup="true". The user can start typing an address in the search field and it will auto-complete the ...
Michael Robert's user avatar
0 votes
0 answers
542 views

Manipulating lightning-input-field time field value

I'm trying to figure out what's the best way to manipulate value for time field from javascript. When loading a record with LDS the value of the time field is an integer represented in milliseconds, ...
alechko's user avatar
  • 53
0 votes
1 answer
1k views

Lightning input type="datetime" not auto-populating values prior to 9am local time

I have a lightning component which has a datetime field, the value of which is auto-initialized with the component's helper.js. The default initialized value is supposed to be today's date and the ...
D.Kat's user avatar
  • 56
0 votes
0 answers
246 views

lightning-input-field with time type not applying gmt offset when saving

I have a lightning-record-edit-form which is rendering a lightning-input-field that happens to be of type Time. The input renders correctly, however when I save the form, the offset from my timezone ...
Daniel Quijada's user avatar
1 vote
0 answers
222 views

Lightning record view form suddenly stopped working from past 2 days [closed]

We have made one LWC in which we are using lighting record view form to display the details of the records. Earlier, it was working fine, but from past two days, whenever we are opening the component, ...
Aarushi's user avatar
  • 11
1 vote
2 answers
2k views

LWC: count amount of checkboxes that are currently checked

I am trying to get the amount of checkbox that are currently checked on a change handler. What I have so far: <template for:each={objInfo.todoList} for:item='todoListItem' class="slds-p-...
JonSnow's user avatar
  • 199
0 votes
1 answer
498 views

Formula Field Is Undefined In Aura Component

I am trying to populate some lightning: inputs in an aura component with a few values. In the example below, {!v.enrollmentRecord.Comments__c} works fine but {!v.enrollmentRecord.OPEID__c} is ...
Austin Kelly's user avatar
0 votes
2 answers
6k views

Regex to validate text field which can contain number and alphabets both

I want to validate an input text field using pattern. I want my field to contain 0-9 a-z A-Z Please help pointing out the error in below code for the same <lightning-input type="text" ...
Gargi Gupta's user avatar
1 vote
0 answers
3k views

LWC Lightning-input-field not showing lookup correctly

I have a LWC where I am using lightning-input-field to display a custom field on custom object which is a look up to other object, it doesn't display correctly. Here's the code : <lightning-layout-...
anxiousAvocado's user avatar
2 votes
0 answers
369 views

Label not being read by screen reader for lightning input field

I'm using a lightning-input-field as a lookup with a custom label. The custom label displays properly and replace the label associated with the field. My issue is that I want the screen reader to read ...
Greg's user avatar
  • 25
0 votes
1 answer
316 views

How can I get my search field to align with the other grid items

I have a header component with a sub-component search field. <template> <div class="header-grid"> <div> New Opportunitites </div> ...
Chuck's user avatar
  • 1,017
5 votes
1 answer
531 views

How to make a required `lightning-input-field` field not required?

Is it possible to make a <lightning-input-field> where field-name is required (such as Contact.LastName) not required on the UI? I would like the field to not kick in validation rules (client ...
jpmonette's user avatar
  • 4,440
6 votes
2 answers
2k views

Error: Unknown public property "name" of element <LIGHTNING-INPUT-FIELD>. This is likely a typo on the corresponding attribute "name"

I am getting this issue in the console: Error: Unknown public property "name" of element . This is likely a typo on the corresponding attribute "name". However, this component was ...
mvk1991's user avatar
  • 565
0 votes
0 answers
434 views

LWC date input not displaying properly

I am facing a issue with lwc input for date. the date picker dropdown is not displaying properly it is being cutout by windows taskbar. I want to display this date picker at top of the field instead ...
Bilal Malik's user avatar
0 votes
1 answer
671 views

How to iterate through an array of input fields with the same name and insert the value in an array?

I have a template that iterates through an array called amountArray and creates input fields for the amounts. The input fields have the same name called fieldAmount. When I enter value, I know which ...
Eric's user avatar
  • 73
0 votes
0 answers
1k views

How can we add onblur event for lightning:inputField

I need to add onblur event for lightning:inputField. Right now as per the documentation (https://developer.salesforce.com/docs/component-library/bundle/lightning:inputField) I dont see a direct by ...
AdityaHM's user avatar
  • 133
3 votes
2 answers
5k views

New record Create option not available in lookup field in <lightning-input-field> tag

All I have a requirement to create a custom Case form with few fields. In Contact lookup, I am not able to see the option to create Contact. Can anyone guide me what I am missing in the code. HTML: &...
Tamil's user avatar
  • 750
0 votes
1 answer
613 views

How to add a search button with a logo?

I want to add a search button to the form, like in the screenshot below and I have the following code that I found in the documentation. <aura:component> ... <div class="...
unique user's user avatar
2 votes
0 answers
66 views

Aura component and LWC are not supporting Nepal locale

I have a requirement where I need to show date in Nepal locale in both Lightning Web and Aura components. This shows the date in, for example - २०२१/२/१७ format in Salesforce but on LWC and Aura, it ...
Bhavya's user avatar
  • 41
0 votes
0 answers
138 views

Highlight the Validation Error on the corresponding Field

Can anyone tell how the implementation of highlighting the validation error at field level can be achieved using Lightning Aura Components? I have tried using validity functionality option in my code ...
Salesforce Developer's user avatar