,

“Handling multiple controlled inputs with one onChange function” #shorts

Posted by






Multiple Controlled Inputs with onChange

Using onChange with Multiple Controlled Inputs

In this example, we will explore how to use the onChange event with multiple controlled inputs in a form.











0 0 votes
Article Rating
1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Realistic Moments
11 months ago

this can be more easy… try this..

function onChange( e ){
setFormData( {. . .formData,[e.target.id ] : e.target.value } )

}