Formatting

S

sue

Hi,

Is there a way to format a textbox such that when the
user types in the number 4000 it will be automatically
formatted to $4,000?

Thanks.
 
P

Phillip Windell

It could be done in a client-side script, but not ASP. ASP could only alter
the input after it is submitted to the server where the ASP runs.
 
S

Suchi

This can be done using VBScript

Sub textbox_onfocusout
document.form1.textbox.value = FormatCurrency(document.form1.textbox.value)
End Sub
 
D

Dave Anderson

CJM said:
What? On my Firefox browser? I dont think so...

The beauty of Firefox, of course, is that a VBScript extension could
conceivably be written for it (not that anyone in the Gecko development or
user community would want to).

OTOH, if FormatCurrency really does achieve the desired result, a server
round-trip would suffice.


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
 
J

joker

I'd recommend a client side JavaScript. This will work in most browsers
too. Try posting in the Jscript newsgroup or a JavaScript newsgroup for
more details, as it is out of the scope of this newsgroup.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,159
Messages
2,570,879
Members
47,417
Latest member
DarrenGaun

Latest Threads

Top