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.

sagasu/JQeury.Numeric

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

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>

About

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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published