,

NumBox jQuery Plugin: Mobile-Friendly HTML5 Numeric Input

NumBox pluginaims to work equally well on desktops and mobile devices, and helps ensure that a numeric keyboard will pop-up on mobile devices when a number is entered.

It offers both real-time validation as you type plus display formatting, and has a lot of customization options.

For example, you could set up NumBox to handle a custom currency with your choice of decimal places, minimum and maximum values, currency symbol and if the symbol goes before or after the value.

When displayed, (not focused for input,) the number is correctly formatted with the appropriate symbol and commas every three digits, etc. During input, as you press each key, before it is displayed, the key press is validated, so you can’t enter non-numeric characters, numbers that are greater or smaller than the allowed range, or a number with an inappropriate number of decimal places, etc.

Download: http://www.numbox.org/download/

Demonstration: http://www.numbox.org/mobile-demo/

Plugin homepage: http://www.numbox.org/

Implementation:

1. First, include CSS and jQuery files

<!-- Place somewhere in the <head> of your document -->
<link rel="stylesheet" href="incjquery.numbox-1.1.0.css" type="text/css" />
<script src="jquery.min.js"></script>
<script src="jquery.numbox-1-1-0-min.js"></script>

2. Build your HTML code

<!-- Place somewhere in the <body> of your page -->
<input id="myInput" type="number" value="" placeholder="Please enter a dollar amount" />

3. Numbox plugin call

<script type="text/javascript">
    $(document).ready(function()
    {
        // Simple Numbox call, without options
        $('#myInput').NumBox();
 
        // Numbox call, with options 
        $('#myInput').NumBox({
          symbol: '£',
          location: 'r'
        });
    });
</script>

Options:

Screenshots:

How a Loop Through a JavaScript Object?

How a Loop through a JavaScript object?Javascript Objects are Variables Containing Variables.In Java…

How to Search Item in List in JavaScript

Multi Step Form Using HTML and JavaScript

Form is the important part in web design. Form is the primary interface to the user by which user is…

How to Create Custom CSS, jQuery Autocomplete Plugin

Web developers often use autocomplete features in websites as a part of their work. Yet lot of good …

How to Make Sticky Sidebar Using jQuery and CSS

Sticky sidebar is an essential part of web development. Not in all cases but for some cases where ou…

Selectors, Animation, and AJAX – jQuery Tutorial And Examples

By now I’m sure you have grasped at least the basics and simplicity of the jQuery library. Now it’s …