Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

129
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda