I have a TextBox on my ASP.NET webpage, where the user can enter a number. What I want to do is as soon as the user moves the focus off that TextBox, to call a piece of JS to pad that number with up to 10 leading zero’s if necessary.
I’ve tried a few things but my JavaScript’s a bit rusty. Any ideas?
In Page_Load add “onblur” attribute to the TextBox and call javascript method to append zeros if required. This is how to do this:
javascript:
Code behind