0

Here's the current code

if (obj&&obj.tagName.toLowerCase()=="input") {
  obj.filter=regex;
  on(obj,"keypress",function(e) {
    if (e.keyCode<32) return true;
    if (!(String.fromCharCode(e.keyCode).match(this.filter))) {
       e.stopPropagation(); e.preventDefault(); return false;
     }
  }
}

It seems to function just fine on Google Chrome but does not seem to work on Firefox. I have no real idea about tailoring javascript to the browser

Anyways I'm sure this is a 2 minute solution.

Thanks for the help.

slicks1
  • 349
  • 1
  • 13
  • I don't see why this doesn't work in Firefox. Can you post a working example on for example jsbin? – Haroen Viaene Apr 06 '16 at 21:23
  • 2
    It would probably take 2 minutes, but only in case you posted relevant html code and complete `keyup` event function. Therefor I forecast it would take 15 to 20 minutes. – skobaljic Apr 06 '16 at 21:24
  • I think after dedicating about 2 minutes I could find the problem. The quasi-duplicate question should answer the question. – Ram Apr 06 '16 at 21:29

0 Answers0