Search
 
SCRIPT & CODE EXAMPLE
 

TYPESCRIPT

salesforce lwc data binding for multiple inputs values

in HTML
<lightning-input name='firstName' label="First Name" onchange={handleChange}></lightning-input>
<lightning-input name='lastName' label="Last Name" onchange={handleChange}></lightning-input>

In Controller
handleChange(event) {
        const field = event.target.name;
        if (field === 'firstName') {
            this.firstName = event.target.value;
        } else if (field === 'lastName') {
            this.lastName = event.target.value;
        }
    }
Comment

PREVIOUS NEXT
Code Example
Typescript :: links a otros components angular 
Typescript :: error TS2531 
Typescript :: nest js null exclude 
Typescript :: shortid typescript 
Typescript :: push in typescript 
Typescript :: react native multi select 
Typescript :: get and set in typescript 
Typescript :: how to check if a value exists in unorderedmaps 
Typescript :: ipywidgets hide widget 
Typescript :: mat card api 
Typescript :: get top elements from a list python 
Typescript :: how to make objects move in roblox studio with a loop 
Typescript :: typescript string concatenation best practice 
Typescript :: type assertions in typescript 
Typescript :: mongodb move documents to another collection 
Typescript :: order documents in firestore 
Typescript :: typescript generics constraints 
Typescript :: typescript vue html css types 
Typescript :: react functional components setstate callback 
Typescript :: open ports for remote access on linux 
Typescript :: Scroll, Position 
Typescript :: aws s3 list objects by size 
Typescript :: typescript named return 
Typescript :: algorithm that prints if one of the numbers is multiple of the other 
Typescript :: how to get an object from array of objects in java 
Typescript :: interface extending mongoose document object does not contain _doc object typescript 
Typescript :: does casting have a higher precedence than dots java 
Typescript :: how to import contacts from android phone to laptop 
Typescript :: benefits of waxing body hair 
Typescript :: hardness of water is due to the presence of salts of 
ADD CONTENT
Topic
Content
Source link
Name
3+8 =