'How to store the id and element name in react js
I need to select a particular employee to assign a task and I am able to assign an employee but meantime I need to store the particular employee Id also in the database. The selection of employees while task adding is from the dropdown list.
<select
className="form-control mb-2"
name="employeeName"
value={addTask.employeeName}
onChange={changeHandler}
>
<option selected>...select...</option>
{employeeTaskState.getAllEmpAccounts.map((list)=>{
return(
<option value={list.name}>{list.name}</option>
)})}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
