Skip to content

Latest commit

 

History

History
42 lines (28 loc) · 1.13 KB

autonumeric.md

File metadata and controls

42 lines (28 loc) · 1.13 KB

Autonumeric

autoNumeric is a jQuery plugin that automatically formats currency and numbers as you type on form inputs.

{% hint style="info" %} Please refer to jQuery autoNumeric Documentation to learn about plugin options {% endhint %}

Step one

Include the javascript file inside the <body>before core template script inclusions, if it's not there already. Please view jQuery plugin inclusion guideline rules

<script src="assets/plugins/jquery-autonumeric/autoNumeric.js" type="text/javascript">

Step two

Add the markup.

<input type="text" data-a-dec="." data-a-sep="," class="autonumeric form-control">

Step three

Apply the plugin.

{% hint style="warning" %} Make sure you place the following script below all the pre-requisites mentioned in the Step two above. {% endhint %}

<script>
$(document).ready(function() {
    $('.autonumeric').autoNumeric('init');
});
</script>