This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Javascript and Storage
#2
It's possible to use built-in pincode control as keypad input. In this example it attaches to an element with Additional class set to showpin. Clicking this element will show the pincode input. Once user inputs 4 numbers (length variable, adjust as needed) the pincode value is sent to 2/1/1.

Custom JavaScript:
Code:
$(function() {
  if (window.$E) {
    // override pin check event to allow custom check callback
    $E.pincode.off('check').on('check', function(event, control, pincode, data) {
      if (data.checkcallback) {
        checkPinResult(control, data.checkcallback(pincode, data));
      }
      else {
        checkPinCallback(event, control, pincode, data);
      }
    });
    
    $('.showpin').off('vclick').on('vclick', function() {
      var length = 4; // pin code length

      showPincode(length, {
        checkcallback: function(pincode) {
          grp.write('2/1/1', pincode);

          return true;
        },
        // not used, do not remove
        callback: function() {}
      });
    });
  }
});
Reply


Messages In This Thread
Javascript and Storage - by esoulintzhs - 03.03.2022, 10:20
RE: Javascript and Storage - by admin - 04.03.2022, 13:13
RE: Javascript and Storage - by esoulintzhs - 10.03.2022, 11:46
RE: Javascript and Storage - by admin - 11.03.2022, 13:17

Forum Jump: