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

243
Views
Cambiar event.target.value en el evento onChange, luego usar checkValidity() pero no funciona

Hola, necesito cambiar event.target.value con una entrada y esa entrada tiene una regla mínima de 8 caracteres. Actualmente estoy haciendo esto (ejemplo) en un componente reaccionar js:

 <input ... minLength={8} onChange={(e) => { onChangeHandler(e); }} />

¿En qué lugar del onChangeHandler estoy haciendo esto?

 e.target.value = 'less8'; console.log(e.target.checkValidity());

Sin embargo, cuando llamo a checkValidity, devuelve 'verdadero', pero esperaba 'falso'.

Depuré esto y es porque cuando asigné un valor a 'e.target.value', la función 'e.target.checkValidity()' ya no funciona.

¿Alguien tiene otra forma de asignar un valor a 'e.target.value' y aún así hacer que 'checkValidity()' funcione?

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!