Format Textbox on exit to Currency

  • Thread starter Patrick J. Schouten
  • Start date
P

Patrick J. Schouten

I am new to ASP/VBScript and I am trying to format a texbox when a
user exits it. In Visual Basic you could put the following in the Exit
property of the textbox:

textbox1 = Format(textbox1, "Currency")

Is this possible in ASP/VbScript? Any help appreciated. Please show
code in your reply, especially where to put this code in the asp page?
Thanks.
 
E

Evertjan.

Patrick J. Schouten wrote on 13 jul 2003 in
microsoft.public.inetserver.asp.general:
I am new to ASP/VBScript and I am trying to format a texbox when a
user exits it. In Visual Basic you could put the following in the Exit
property of the textbox:

textbox1 = Format(textbox1, "Currency")

Is this possible in ASP/VbScript?

No, it has a

FormatCurrency Function
FormatNumber Function

see:

<http://msdn.microsoft.com/library/
en-us/script56/html/vsfctformatnumber.asp>
 
A

Aaron Bertrand [MVP]

You could use client-side JavaScript, with an onblur() event.

<input type=text onblur='someFunction(this);'>

Please follow up in a client-side group for more information.
 
J

John Ogi

There is a format currency function in VBScript also. But
the thing you are missing is that in order to use that in
your asp server-side code, you will have to submit the
form first. It is possible to use VBScript on the client-
side, but that is only advisable if you have control over
the browser the users are using. IE with VBScript
enabled. In that case u can write script tags with the
appropriate calls to your vbscript code. like this:

u can call a function
<input type="text" name="blah" onBlur="FormatThis(this);">

or call the FormatCurrency function
<INPUT type="text" name="blah"
onBlur="VBSscript:FormatCurrency(no reference handy)">


GL
 
P

Patrick Schouten

Thanks. Looks like I have a bit to learn about ASP. I am still trying to
get the hang of "server side" and "client side" scripts. Thanks for the
help.
 

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
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top