|
-
Mar 10th, 2003, 05:33 AM
#1
Thread Starter
Member
Validate a Textbox - HeLp!!!! [Resolved]
Hello!
I need a function in JavaScript to validate the data from a textbox.
Examples:
Textbox: 123
After validate: 123,00
Textbox: 123,4
After validate: 123,40
Textbox: 123,45
After validade: 123,45
Textbox: 1234,5
After validate: 1.234,50
Can anyone help me? Thanks a lot!
Last edited by Evolute; Mar 12th, 2003 at 07:52 AM.
-
Mar 12th, 2003, 01:14 AM
#2
Lively Member
what?
'
u just want to add '0' at the end of each given number?
-
Mar 12th, 2003, 04:08 AM
#3
Thread Starter
Member
No..
I want to format the number that a certain user writes in a textbox. For example:
If the number in the textbox, wrote by the user is: 150
then the program have to format it to have 2 decimals.
Once a button is pressed.. the value must become: 150,00
If it was: 150,3 it must become: 150,30
If it was: 150,45 it stays like that because it already have 2 decimals.
and if the number is too big, like: 145700,4
the number must have 2 decimal cases (as before) and a point (.) It must become: 145.700,40
I know this is a lot of work.. but if someone could help me.. I would be very happy.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|