Numeral formatting
var myinput = new Inpux("#input", {
type: "numeral",
numeralStyle: "thousand",
emptyToZero: false
});
type: "numeral",
numeralStyle: "thousand",
emptyToZero: false
});
Date formatting
var myinput = new Inpux("#input", {
type: "date",
pattern: ["Y", "m", "d"],
delimiters: "-"
});
type: "date",
pattern: ["Y", "m", "d"],
delimiters: "-"
});
Time formatting
var myinput = new Inpux("#input", {
type: "time",
pattern: ["h", "m"]
});
type: "time",
pattern: ["h", "m"]
});
Credit card formatting
custom
var myinput = new Inpux("#input", {
type: "custom",
blocks: [4, 4, 4, 4],
delimiters: " ",
onlyNumbers: true,
contained: true
});
type: "custom",
blocks: [4, 4, 4, 4],
delimiters: " ",
onlyNumbers: true,
contained: true
});
Phone number formatting
custom
var myinput = new Inpux("#input", {
type: "custom",
delimiters: ["(", ")", " ", "-"],
blocks: [0, 3, 0, 3, 4],
onlyNumbers: true,
contained: true
});
type: "custom",
delimiters: ["(", ")", " ", "-"],
blocks: [0, 3, 0, 3, 4],
onlyNumbers: true,
contained: true
});
Custom formatting
custom
var myinput = new Inpux("#input", {
type: "custom",
delimiters: "/-",
blocks: 3
});
type: "custom",
delimiters: "/-",
blocks: 3
});