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

199
Views
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 answers
Answer question

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 Report
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!