Results 1 to 3 of 3

Thread: Validate a Textbox - HeLp!!!! [Resolved]

  1. #1

    Thread Starter
    Member Evolute's Avatar
    Join Date
    Sep 2002
    Location
    Portugal
    Posts
    58

    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.

  2. #2
    Lively Member
    Join Date
    Oct 2001
    Location
    asia
    Posts
    87
    what?
    '
    u just want to add '0' at the end of each given number?

  3. #3

    Thread Starter
    Member Evolute's Avatar
    Join Date
    Sep 2002
    Location
    Portugal
    Posts
    58
    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.
    Evolute

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width