{"_id":"jquery.numeric","_rev":"3-bd4c4154d828ddfecd24d51967cc9143","name":"jquery.numeric","description":"jQuery.numeric() allows only valid numbers to be typed into a text box. Can take negative numbers and a decimal point. You can also supply a callback that runs when focus is lost and the value in the text box is not a valid number.","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"jquery.numeric","version":"1.0.0","description":"jQuery.numeric() allows only valid numbers to be typed into a text box. Can take negative numbers and a decimal point. You can also supply a callback that runs when focus is lost and the value in the text box is not a valid number.","main":"jquery.numeric.js","author":{"name":"Sam Collett"},"license":"MIT","gitHead":"b3b84b1655b7de5ab7d21fc7f4c3d439bde78f88","_id":"jquery.numeric@1.0.0","scripts":{},"_shasum":"7292f8c90447d1fd41c094b4d680bda957622976","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.3","_npmUser":{"name":"jsas-development","email":"atendimento@jsas.com.br"},"dist":{"shasum":"7292f8c90447d1fd41c094b4d680bda957622976","tarball":"https://registry.npmjs.org/jquery.numeric/-/jquery.numeric-1.0.0.tgz","integrity":"sha512-iCdLaB4ivP7iEyUzp6EjAusluIwLHhpvFbO+HEiFEpoXSEzlFjw7xr+pkVJ6jjyxGBFJDmk5tofoZUNdbu6rvA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDV8sXxDU8D4aUKt+Qr7cbQILJjOWwAxjZ/asV+TzzmEAiEAoyHexdr/QGCYS4rQFRSvZzwxGUuUXVIbRTDw76SWDqc="}]},"maintainers":[{"name":"jsas-development","email":"atendimento@jsas.com.br"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jquery.numeric-1.0.0.tgz_1498954482577_0.4336936248000711"}}},"readme":"# jQuery.numeric()\r\n\r\nAllows only valid numbers to be typed into a text box. Can take negative numbers and a decimal point. You can also supply a callback that runs when focus is lost and the value in the text box is not a valid number.\r\n\r\nOriginal Plugin: http://www.texotela.co.uk/code/jquery/numeric/.\r\n\r\n## Installation\r\n\r\n* Install with [npm](https://npmjs.org): `npm install jquery.numeric --save`\r\n* [Download the latest release][download]\r\n* Clone the repo: `git clone https://github.com/nox-it/jquery-numeric.git`\r\n\r\n## Usage\r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n    <head>\r\n        <script type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js\"></script>\r\n        <script type=\"text/javascript\" src=\"jquery.numeric.min.js\"></script>\r\n    </head>\r\n    <body>\r\n        <form>\r\n            <label for=\"numbers-only\">Numbers only:</label>\r\n            <input class=\"numeric\" type=\"text\" id=\"numbers-only\" />\r\n            <br /><br />\r\n            <label for=\"integers-only\">Integers only:</label>\r\n            <input class=\"integer\" type=\"text\" id=\"integers-only\" />\r\n            <br /><br />\r\n            <label for=\"positive\">No negative values:</label>\r\n            <input class=\"positive\" type=\"text\" id=\"positive\"/>\r\n            <br /><br />\r\n            <label for=\"no-negative\">No negative values (integer only):</label>\r\n            <input class=\"positive-integer\" type=\"text\" id=\"no-negative\"/>\r\n            <br /><br />\r\n            <label for=\"decimal-2-places\">Numbers with up to 2 decimal places:</label>\r\n            <input class=\"decimal-2-places\" type=\"text\" id=\"decimal-2-places\"/>\r\n            <br /><br />\r\n            <label for=\"alternative-decimal-separator\">Alternative (,) changes to standard (.) decimal separator:</label>\r\n            <input class=\"alternative-decimal-separator\" type=\"text\" id=\"alternative-decimal-separator\"/>\r\n            <br /><br />\r\n            <label for=\"alternative-decimal-separator-reverse\">Reverse change from alternative (.) to standard (,) decimal separator:</label>\r\n            <input class=\"alternative-decimal-separator-reverse\" type=\"text\" id=\"alternative-decimal-separator-reverse\" />\r\n            <br /><br />\r\n            <a href=\"#\" id=\"remove\">Remove numeric</a>\r\n        </form>\r\n        <script type=\"text/javascript\">\r\n            $('.numeric').numeric();\r\n\r\n            $('.integer').numeric(\r\n                false,\r\n                function () {\r\n                    alert('Integers only');\r\n                    this.value = '';\r\n                    this.focus();\r\n                }\r\n            );\r\n\r\n            $('.positive').numeric(\r\n                {negative: false},\r\n                function () {\r\n                    alert('No negative values');\r\n                    this.value = '';\r\n                    this.focus();\r\n                }\r\n            );\r\n\r\n            $('.positive-integer').numeric(\r\n                {decimal: false, negative: false},\r\n                function () {\r\n                    alert('Positive integers only');\r\n                    this.value = '';\r\n                    this.focus();\r\n                }\r\n            );\r\n\r\n            $('.decimal-2-places').numeric({decimalPlaces: 2});\r\n\r\n            $('.alternative-decimal-separator').numeric({altDecimal: ','});\r\n\r\n            $('.alternative-decimal-separator-reverse').numeric({altDecimal: '.', decimal: ','});\r\n\r\n            $('#remove').on(\r\n                'click',\r\n                function (e) {\r\n                    e.preventDefault();\r\n\r\n                    $('.numeric,.integer,.positive,.positive-integer,.decimal-2-places,.alternative-decimal-separator,.alternative-decimal-separator-reverse').removeNumeric();\r\n                }\r\n            );\r\n        </script>\r\n    </body>\r\n</html>\r\n```\r\n\r\n","maintainers":[{"name":"jsas-development","email":"atendimento@jsas.com.br"}],"time":{"modified":"2022-06-19T05:22:20.235Z","created":"2017-07-02T00:14:43.994Z","1.0.0":"2017-07-02T00:14:43.994Z"},"author":{"name":"Sam Collett"},"license":"MIT","readmeFilename":"README.md","users":{"jsas-development":true}}