
tiagomacul
Mega Sage
Options
- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
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.
- 269 Views
Comments
User674366
Tera Explorer
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
05-27-2019
02:49 PM
Thanks for sharing this.