Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

236
Vistas
React Semantic UI Form - Two submit buttons

I'm pretty new at ReactJs, I'm trying to submit a form, but one of the form values must depend on which submit button triggers the submit

I've coded something like this

<Form onSubmit={(e) => {
        e.preventDefault();
        const {target} = e;
        console.log('FormData', Object.fromEntries(new FormData(target)));
      }}>
... form fields ...
<Button icon="thumbs up" type="submit" content="Authorize" name="status" value="A" positive />
<Button icon="thumbs down" type="submit" content="Reject" name="status" value="R" negative />
</Form>

The log shows all form values correctly but the "status" field. Is there any way to achieve the expected behaviour? Any alternative is very welcome

Thank you

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can get the status value from the submit button on the event.submitter property and append this to the FormData.

See this answer for more info:

https://stackoverflow.com/a/64857928/681058

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda