Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

131
Views
MultiSelect with formState issue on form Submit

I am using MultiSelect inside a form and wanted to set the formState with the selected values using onChange.

At present, the below code passes the default null value for permission_sets on form submit.

Can someone take a look and let me know how to update the value of permission_sets inside formState from onChange on dropdown selections. This will pass the actual selected values on the form Submit.

const formState = {
  permission_sets: "",
}

function updateFormState(key, value) {
  formState[key] = value;
}

function App() {
  const [permission_sets, set_permission_sets] = useState([]);
  return (
          <Form.Group>
          <Form.Label>permission_sets</Form.Label>
          <MultiSelect
           options={[
            { label: "Operations", value: "Operations" },
            { label: "ReadOnlyAccess", value: "ReadOnlyAccess" },
            { label: "Dba", value: "Dba"},
            ]}
           id="permission_sets" 
           labelledBy="Select"
           value={permission_sets}
           onChange={set_permission_sets}    
          />
         </Form.Group>
<Button onClick={validate}>Submit Request</Button>
)}
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!