Skip to content
Allows only valid characters (i.e. numbers) to be typed into a text box. Can take negative numbers and a decimal point. You can supply a callback that runs when focus is lost and the value in the text box is not a valid number.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Content/Scripts
JQeury.Numeric.1.0.0.nupkg
README

README

Allows only valid characters (i.e. numbers) to be typed into a text box. Can take negative numbers and a decimal point. You can supply a callback that runs when focus is lost and the value in the text box is not a valid number.

I am not an owner of a source code. I just created a nuget package to keep all dependencies in nuget. All the credit goes to http://www.texotela.co.uk/.

I decided to fork, because Author do not anwser emails, and seems to not be interested in a project any more.

Feel free to contact me in order to fix some bugs or add features.

In order to run it place in a view:
<script type="text/javascript">
    $(".numeric").numeric();
	$(".integer").numeric(false, function() { alert("Integers only"); this.value = ""; this.focus(); });
	$(".positive").numeric({ negative: false }, function() { alert("No negative values"); this.value = ""; this.focus(); });
	$(".positive-integer").numeric({ decimal: false, negative: false }, function() { alert("Positive integers only"); this.value = ""; this.focus(); });
</script>
You can’t perform that action at this time.