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

137
Views
How to block a "Comma" in HTML input with Firefox browser?

How to block a "Comma" in HTML input with Firefox browser?

This Javascript code works for Opera Browser:

          // ----- Block the "COMMA" for all inputs.
     $(document).keydown(function(e) {
         var keyCode = e.keyCode || e.which;
         if(keyCode==188){
             //  alert("COMMA has been pressed on the keyboard...") ;
             e.preventDefault();   // Note, "preventDefault" has to be within "if".
         }

     });
about 4 years ago · Santiago Gelvez
2 answers
Answer question

0

Here is what worked for Firefox and 2 other browsers:

           // ----- Block the "COMMA" for all inputs.
     document.addEventListener('keydown', function(e) {
               if (e.key === ',') {
                   e.preventDefault();
                   return false;
               }
            })

Thanks

about 4 years ago · Santiago Gelvez Report

0

keyCode has been deprecated. Use e.key instead.

document.addEventListener('keydown', e => {
  if (e.key === ',') {
        e.preventDefault();
        return false;
    }
})
about 4 years ago · Santiago Gelvez 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!