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

93
Vistas
How to check, whether the user has pressed done button on iphone using Reactjs

I have an application created using Reactjs and in the application,i have a form when a user presses done or return button on iOs device i want to submit that function.As i tried but it's only working when user presses return button.

function Counter() {
    const [otp,setOTp]=useState('')
    const handleSubmit = (e) => {
    e.preventDefault();
//    conform alert
        var r = window.confirm("Are you sure you want to submit?");
        if (r === true) {
            alert("Submitted");
        } else {
            alert("Cancelled");
        }
        
}
  return (
      <div>
          <form onSubmit={handleSubmit}>
              <input type="text" placeholder="Enter OTP" value={otp} onChange={(e)=>setOTp(e.target.value)} />
                <button type="submit">Submit</button>
         </form>
      </div>

Image

about 4 years ago · Juan Pablo Isaza
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