Announcing the Global SNUG Board of Directors. Learn more here
on 02-05-2019 10:39 AM
How to format mac addresses? / Como formatar o número do mac addresses?
function onLoad() {
var field = g_form.getElement('IO:f6361262db53a7406931140314961999');
function formatMAC(e) {
var r = /([a-f0-9]{2})([a-f0-9]{2})/i;
var str = e.target.value.replace(/[^a-f0-9]/ig, "");
while (r.test(str)) {
str = str.replace(r, '$1' + ':' + '$2');
}
e.target.value = str.slice(0, 17);
}
field.on('keyup', formatMAC);
}
Observação:
Para pegar o ID do elemento, utilize o inspecionar.
Author:
Tiago Macul
Update set planning changes / Update set Planejando e executando mudanças no ambiente.
Thanks for sharing this.