input box reset after esc was pressed

input box reset after esc was pressed

  

hello,

  the keyboard key "esc" seems to be related to reset data of input box, how can i avoid this?  

  btw, i use google chrome, i don't know if this matters.

thanks

Hi,

This behaviour is implemented by OutSystems if input widgets are placed inside a form widget (see https://success.outsystems.com/Documentation/10/Reference/Web_Interfaces/Designing_Screens/Form_Widget)

So if you place your inputs outside a form widget, the behavior is not implemented. However if that is of any use for your project I can not oversee.

Regards,

Daniel



Hi Sun,

You can have some javascript logic like below to stop this behaviour.

$(document).keydown(function (e) {
    if(e.keyCode==27){
     e.preventDefault();
    }
});


Regards

-PJ-

PRAMOD JAIN wrote:

Hi Sun,

You can have some javascript logic like below to stop this behaviour.

$(document).keydown(function (e) {
    if(e.keyCode==27){
     e.preventDefault();
    }
});


Regards

-PJ-

thank you, i tried but it didn't work.  

however, why i have to set keyCode == 27 ? or what shoud i do to get the default keycode of "esc" ?


Best wishes

Sun


Hi Sun,

On computer keyboards, the Esc key (named Escape key in the international standard series ISO/IEC 9995) is a key used to generate the escape character (which can be represented as ASCII code 27 in decimal. So when you press a key this will tell you if the key pressed is ESC key or not .

You can also try to change is like this ..


$(document).keydown(function (e) {
    if(e.keyCode==27){
    return false;
    }
});



Regards

-PJ-

PRAMOD JAIN wrote:

Hi Sun,

On computer keyboards, the Esc key (named Escape key in the international standard series ISO/IEC 9995) is a key used to generate the escape character (which can be represented as ASCII code 27 in decimal. So when you press a key this will tell you if the key pressed is ESC key or not .

You can also try to change is like this ..


$(document).keydown(function (e) {
    if(e.keyCode==27){
    return false;
    }
});



Regards

-PJ-

thanks for your reply again, it still didn't work, i'm not sure if I set this logic in the right position. I'm new here. XD!

can you offer more detail ? thanks



Best

Sun