|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Announcements
Services
Chapters
Feature Zones
|
Note: This is an unedited contribution. If this article is inappropriate,
needs attention or copies someone else's work without reference then please
Report This Article
IntroductionThe control uses javascript to handle number formatting as you keep typing and does the validation as well. For one of our requirement, we needed a javascript based control that did formatting as the users kept typing. Google search only yielded script that did formatting on focus change events only. So I went about creating a new control myself. Background
The idea for this control came from one of our client requirement that needed a small javascript to have a textbox that will take big numbers. The numbers can have unlimited decimal places. Also the script will do 3 things at the same time. Using the codeUsing the control is very easy and just needs adding the javascript code from the source page. On the textbox on which the formatting needs to be applied, use the following code
onkeypress="return ValidateNumberKeyPress(this, event);" onkeyup="ValidateNumberKeyUp(this);"
onblur="ValidateAndFormatNumber(this)"
Points of InterestScript is preety easy to read and understand. Some references that were used during the course of the script creation
|
|||||||||||||||||||||||||||||||||||||||||||||||||||