04.03.2022, 13:13
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:
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() {}
});
});
}
});