CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 1 of 1

Thread: Format asp.net textbox (add period) in currency format as user type in

  1. #1
    Join Date
    Dec 2011
    Posts
    5

    Question Format asp.net textbox (add period) in currency format as user type in

    I am using asp.net textbox, I want the textbox display currency format as user type-in, the tricky requirement is that automatically add a period (.) before the last two digits, reason for that to prevent user enter a large amount accidentally, so for example:

    user entered 1 => 1 (or 1.00)

    user entered 12 => 12 (or 12.00)

    user entered 123 => 1.23

    1234 => 12.34

    123400 => 1234.00

    123456 => 1234.56

    etc.

    And also not allow enter any thing else rather than 0 -> 9 (0123456789), the $ sign don't need to be in the textbox but if you can make it to be in front of the number it will be even better, after on before save to database I will need to trim it down anyway.

    I tried to used AJAX MaskedEdit at http://www.ajaxcontroltoolkit.com/Ma...askedEdit.aspx but they are not really helping me archive this since it is predefined format. I don't know java-script so I really need help.
    Last edited by longbodie; October 24th, 2014 at 08:56 AM.

Tags for this Thread

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)