jsInputFormatter is a easy way to format HTML inputs with masks.

Syntax:

import the jsInputFormatter.js
set the function below on oninput event to input format.

inputFormatter(event,mask)
event: element input event
mask: String with mask
# - Any valid number
* - Anything
Others characters don't change

inputDecimalFormatter(event,decimal)
event: element input event
decimal: Integer number with decimal

Example 1 - Credit Card:

Credit Card #### #### #### ####
<input id="cartao" type="text" oninput="inputFormatter(event,'#### #### #### ####')"/>

Example 2 - Phone number:

Brazil Phone number (##)*####-####
<input id="phone" type="text" oninput="inputFormatter(event,'(##)*####-####')"/>

Example 3 - Decimal number :

Decimal 0.00
<input id="valor" type="number" oninput="inputDecimalFormatter(event,2)" value='0.00'/>

Features

  • input formatter
  • format mask
  • javascript formatter

Project Samples

Project Activity

See All Activity >

License

GNU General Public License version 3.0 (GPLv3)

Follow jsInputFormatter

jsInputFormatter Web Site

Other Useful Business Software
Get Avast Free Antivirus | Your top-rated shield against malware and online scams Icon
Get Avast Free Antivirus | Your top-rated shield against malware and online scams

Boost your PC's defense against cyberthreats and web-based scams.

Our antivirus software scans for security and performance issues and helps you to fix them instantly. It also protects you in real time by analyzing unknown files before they reach your desktop PC or laptop — all for free.
Free Download
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of jsInputFormatter!

Additional Project Details

Intended Audience

Developers, End Users/Desktop

Programming Language

JavaScript

Related Categories

JavaScript HTML XHTML, JavaScript User Interface (UI) Software

Registered

2019-06-17