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

193
Vistas
Allow List of words in <textarea> before submit JavaScript or jQuery

I have seen some similar posts of "Block words in text area using JS or jQuery"

Examples: Case 1: If list of words are: feel, appointment, only, attend, laser, submit

Case 2. Once a user hit the submit button a message should appear saying: "invalid codes" if any of those words are not in the list

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

0

If your goal is to check if a given string has certain words, you can use a regular expression such as:

const regex3 = /^(?=.*\bfeel\b)(?=.*\bappointment\b)(?=.*\bonly\b)(?=.*\battend\b)(?=.*\blaser\b)(?=.*\bonly\b).*$/ig

console.log(regex3.test(yourInputText)) //returns true if the string has the words in it

if you wanna add more words, just create more statements, example:

(?=.*\bYOUR_NEW_WORD\b)
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