i want, when i type a number in text box to format the number,
so i will get :
i tried to use this code : http://blog.stevenlevithan.com/archives/commafy-numbers
to format number when using the keyup event.
(i tried to use code from other sources too but i get the same problem):
when i copy paste the number the code works great and the number is formated as excpected,
but when i try i get : 1,234,5,678
The onkeyup event can't be called many times with this function !
After the first change, it is necessary to remove at first the commas. Change the function to remove it at first with a str=val.replace(/,/g,'').
09-01-2013, 07:13 AM
i do :
str = str.replace(",", "");
09-01-2013, 02:54 PM
Sorry ! You are right.
I do not understand the proposed asp code with a run at server ?
Could you please post the result HTML page (or an extract).