Add Currency Mask to Number Form Fields
This code adds a currency input mask to JetFormBuilder text fields with the currency-mask class. It loads the Inputmask library and applies a U.S. dollar formatting style automatically when the form initializes.
Specifications
Add Currency Mask to Number Form Fields
5 January, 2026
-
Plugin
-
Category
-
Programming languages
Installing Instruction
- Copy the provided JavaScript code snippet to your clipboard.
- Add the code using one of the following methods:
-
Option A: Using a Custom Code Plugin (Recommended)
- Install and activate a plugin such as WPCode Lite, Code Snippets, or Simple Custom CSS and JS.
- Create a new JavaScript snippet.
- Paste only the JavaScript code, without <script> tags.
- Save and activate the snippet.
-
Option B: Using a Custom Code / HTML Area
- Add the code in a Custom HTML widget or directly into a theme file (for example, header.php or footer.php).
- Keep the <script> tags when using this method.
- Save your changes.
-
Option A: Using a Custom Code Plugin (Recommended)
Example Use Case
Use this snippet to ensure consistent currency input formatting across forms, improving data quality and user experience on e-commerce, booking, or payment-related forms.
Applicable scenarios:
- E-commerce product or checkout forms requiring currency inputs.
- Booking or rental forms that accept price values.
- Any forms where real-time formatted currency input is needed.
Specifications
Add Currency Mask to Number Form Fields
5 January, 2026
-
Plugin
-
Category
-
Programming languages