[Javascript] Re: Opera onKeyPress

Sabrina Leandro saleandro at yahoo.com
Mon Sep 8 14:22:42 CDT 2003


Hey Chris,

Below is my script.. but since this seems to be a bug
in Opera, I thought the script wouldn´t matter... as I
said, the bug was reported on 2 different functions
and also on a different website (other than mine)

But here is my script anyway, hope it can help :)

Sabrina
---------------------------------------------------
   function filtro(form, format) {
      var input = form.value;
      if (input.length > 0) {
           var numbers = "";
           for(var i = 0; i < input.length; i++) {
              var umChar = input.charAt(i);
              if(isNaN(umChar) " ") 
                       numbers += umChar;
           }
           var output = "";
           var n = numbers.length - 2;
           var i = 0;
           while(i < input.length + 1) {
                 if(i == n) {
                     output += numbers.charAt(i) +
',';
                  } else {
                      output += numbers.charAt(i)
                  }
                  i++;
           }
           form.value = output;
        }
}

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com



More information about the Javascript mailing list