Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
155
WebNumericEdit (Dot and Comma)
posted

Hi,

I have a WebNumericEdit field and I want that if the user type a comma or a dot, the control work. For now, it's only work with comma (probably because that what it is in my Windows configuration).

Ex : (123,45 or 123.45)  will do the same.

thx

  • 155
    posted

    Its work!

    thx alot! 

  • 24497
    posted

    Hi,

    The WebTextEdit allows to filter/modify/cancel/etc. keyboard. The oEvent.keyCode will replace any entry. The value of decimal separator is stored in decimalSeparator member variable. So, you may process ClientSideEvents.KeyPress and fake coma and dot as decimal separators.

    function WebNumericEdit1_KeyPress(oEdit, keyCode, oEvent)
    {
      if(keyCode != 44 && keyCode != 46)// coma and dot
         return;
      var separatorCode = oEdit.decimalSeparator.charCodeAt(0);
      oEvent.keyCode = separatorCode;
    }