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

386
Vistas
Form submit button not working on mobile in React JS

I am learning React JS. I used BootStrap's form in a React JS web application. Submit button is working fine on laptop but not working on mobile devices.

On Mobile, when I touch on the button its border gets highlighted but didn't perform any action. But I have noticed one thing that the HandleSubmit function is not triggering. But if I change onClick tag to onClick = {alert("Working");} it works on mobile.

Full code repository is here: https://github.com/AhmadRaza365/iNoteBook

Forms can be found in these components: components/Login.js, Signup.js, AddNote.js

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

0

In Login.js you have a typo: onClicK (capital K) vs onClick.

But your main problem is that you're mixing up two ways of submitting a form

  1. <form onSubmit={...}> combined with a <button type='submit'> inside the form. In this type of combination, you don't need an onClick on the button. Effectively <button type='submit>, tells the browser that when someone clicks on the button, go ahead and execute the function you passed to onSubmit specified in <form>.

  2. <form> without onSubmit set on the form element and a button inside the form without type='submit but only an onClick which needs to manually reset the form and do all the subsequent logic associated with given form.

You should choose one or the other for each of your 3 forms – don't use both on a form.

about 4 years ago · Juan Pablo Isaza Denunciar

0

I have found the error. Basically, forms are working well. The problem was with my localhost API. I was accessing it without port and URL forwarding. And as I am using await function to fetch and post data to API. But API was not connected. As a result, it was not forwarded next.

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