Phone serialization
In this example we're creating input for phone number that starts with +1 or +4. Property createHiddenInput tells tformat to create a hidden input that stores unformatted phone number for form. Unformatted value can be shown by pressing button.
Handle input change
In this example we're using tformat onchange event to show card payment system. American Express cards starts with 3 (it's the first template prefix), VISA cards starts with 4 (it's the second template prefix) and so on.
Acceptable cards:
- American Express
- VISA
- Mastercard
Multiple templates
In this example we're using multiple templates. If user selects "Phone number" from dropdown then template will be changed to +1 xxx xxx xx xx.