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

90
Views
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
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!