Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

commas in a textbox?? 3

Status
Not open for further replies.

Gamera99

Programmer
May 17, 2001
59
JP
Problem: They want commas in numeric data in a textbox.

I am an experienced .NET programmer, and I make a lot of websites with financial calculations, text boxes, reports etc.
I have a particular page that has numerous textboxes for a person to type in numeric data; I validate the textboxes etc. when the data is submitted, etc.
Whenever I display such data outside of a textbox I always use formatnumber, formatcurrency, etc., depending on the type of data. If a person puts commas in the textbox, I strip them out with replace statement before I validate it.
HEre is my problem; a meddler in my company wants the textbox to always display commas like formatted statements do. So if I open the page, and textboxes are prepopulated with data, that data must use commas.
Well, that goes against all of the "best work practices" and standards that I have ever seen.
What do you people think? Have you ever done this? I want to completely ignore it and apply some technical rationale to it; we simply don't do data forms this way, etc.
Does anyone have any ideas about this?
Thank you
Nelson
 
USER is a 4 letter word!

That said, I have found it necessary to do all sorts of things to keep them happy that I would otherwise not have done.

Fortunatly you can use the format function reasonably easliy to format the contents of a textbox..

In VB6 I would have just used the Maskededit box...
You still can, it just needs to be the old COM version. Of course you could use the VS2005 beta.. I think they have a dot.net one.

Otherwise USER is a 4 lettter word!

[upsidedown]
 
Couldn't you format the number the way the user wants to see it before applying it to the textbox's Text? Seems liek this would work since you are removing the formatting when they submit anyway.

Greetings,
Dragonwell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top