Define dinamic pattern

if(newv == 1 || newv == 5){
$$(‘formViewRecapitiAdd’).elements[‘valore’].define(‘pattern’,{mask:"### ### ## ##", allow:/[0-9]/g});
$$(‘formViewRecapitiAdd’).elements[‘valore’].refresh();
}

Hello,

Unfortunately, the pattern cannot be defined dynamically - it must be set at view initialization.

On the positive side, you can set any pattern (e.g. the one that allows everything) at view init and then change its value depending on another control:

https://snippet.webix.com/a878qk65

But for me the cleaner solution would be to have two inputs (with and without the pattern) and show/hide them in turn.

thanks !