Question
Roche
IN
Last activity: 9 Oct 2020 10:41 EDT
Number format not working as expected in Mozzila firefox
Hello All,
As we know that the validation in number field does not work in firefox i.e. it accepts the text characters also. I need to avoid this.Does anyone has the javascript for the same which is working.
Though I tried below as mentioned in one of the post but it is not working either.:
https://community.pega.com/support/support-articles/input-type-number-accepting-text-charachter
UserWorkForm HTML fragment.
<script> pega.u.d.attachOnload(function(){ varnumberElements=document.querySelectorAll(".ie input[type='number']"); debugger; for(vari=0;i<numberElements.length;i++){ numberElements[i].addEventListener('keydown', function(e) { var key = e.keyCode ? e.keyCode : e.which; if (!( [8, 9, 13, 27, 46, 110, 190].indexOf(key) !== -1 || (key == 65 && ( e.ctrlKey || e.metaKey ) ) || (key >= 35 && key <= 40) || (key >= 48 && key <= 57 && !(e.shiftKey || e.altKey)) || (key >= 96 && key <= 105) )) e.preventDefault(); }); }}); </script>
Please help me with the javascript if anyone is having that
Regards,
Debashish Bhowmik
Hello All,
As we know that the validation in number field does not work in firefox i.e. it accepts the text characters also. I need to avoid this.Does anyone has the javascript for the same which is working.
Though I tried below as mentioned in one of the post but it is not working either.:
https://community.pega.com/support/support-articles/input-type-number-accepting-text-charachter
UserWorkForm HTML fragment.
<script> pega.u.d.attachOnload(function(){ varnumberElements=document.querySelectorAll(".ie input[type='number']"); debugger; for(vari=0;i<numberElements.length;i++){ numberElements[i].addEventListener('keydown', function(e) { var key = e.keyCode ? e.keyCode : e.which; if (!( [8, 9, 13, 27, 46, 110, 190].indexOf(key) !== -1 || (key == 65 && ( e.ctrlKey || e.metaKey ) ) || (key >= 35 && key <= 40) || (key >= 48 && key <= 57 && !(e.shiftKey || e.altKey)) || (key >= 96 && key <= 105) )) e.preventDefault(); }); }}); </script>
Please help me with the javascript if anyone is having that
Regards,
Debashish Bhowmik