K2 Input Formatter is a lightweight JavaScript library designed to enhance user experience in web forms through strict control and real-time automatic formatting of data. It transforms conventional input fields into specialized components that handle numbers with thousands separators and decimals, as well as date-time fields (dd/mm/yyyy hh:mm:ss), ensuring that entered data is always valid before submission. Among its key features are an advanced history system (undo/redo) based on WeakMap for memory optimization, automatic normalization when pasting text from the clipboard, and smooth keyboard navigation allowing users to jump between fields via the Enter key — offering a robust, intuitive, and format-error-free interface.
Automatic thousands separator using a period. Use comma or the numpad period key as decimal separator.
Format: dd/mm/yyyy hh:mm:ss. Type only the digits and press Enter to complete. Enter on each field moves to the next one.
If this library has been useful to you, please consider making a donation.
Every contribution helps maintain and improve the projects.