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

148
Views
I want to stop user to input in a specific moment by JavaScript

I have a textarea where I have created a limitations of 0/150 word the 0 number increases 1, 2, 3 like that and when it goes to 150/150 I want that textarea not to take more inputs now I have tried to disable the textarea it works but user cant undo their text so actually I want that it stop taking more inputs plus user can undo their changes not disabling the textarea

if(document.getElementById("maximum_length").innerText==150){
  document.getElementById("pro_desc").disabled = true;
}
else if(document.getElementById("maximum_length").innerText<=150){
  let current = document.getElementById("maximum_length").innerText
  document.getElementById("maximum_length").innerText = Number(current) + 1;
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Try to use maxlength attribute:

<textarea maxlength="150">
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!