Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Javascript works in Firefox but not in Chrome, IE

Swathi BR-OracleNov 15 2018 — edited Nov 16 2018

Hi,

JDeveloper version: 12.2.1.2.0

Below is the script to restrict input to numbers only in the ADF page, the code works fine in Firefox, but not in chrome, IE. I tried clearing the cache and reinstalling google chrome but no luck. Please find the below version of each browser.

FF: 60.3.0esr (32-bit) upto date

Chrome: Version 70.0.3538.102 (Official Build) (64-bit)

IE: Microsoft Edge 41.16299.726.0

<af:resource type="javascript">

                      function filterForNumbers(evt) {

                         var charCode = (evt.which) ? evt.which : evt.keyCode;

          if (charCode != 46 &amp;&amp; charCode > 31

            &amp;&amp; (charCode &lt; 48 || charCode &gt; 57))

             return false;

          return true;

                      }

                      function enableCalendarOnly(evt) {

                          evt.cancel();

                      }

              </af:resource>

If you could help me to find solution I'd appreciate it. By the way, I did read the other similarly titled question, but it didn't seem to answer this.

Thanks,

Swathi

Comments
Post Details
Added on Nov 15 2018
5 comments
863 views