469,360 Members | 1,799 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,360 developers. It's quick & easy.

Format Textbox on exit to Currency

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.
Jul 19 '05 #1
4 14400
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.


"Patrick J. Schouten" <ps***********@hotmail.com> wrote in message
news:1b**************************@posting.google.c om...
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.

Jul 19 '05 #2
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>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #3
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
-----Original Message-----
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>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
.

Jul 19 '05 #4
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.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by DD | last post: by
4 posts views Thread by Gerry Abbott | last post: by
3 posts views Thread by Claudia Fong | last post: by
8 posts views Thread by drose0927 | last post: by
2 posts views Thread by AMDRIT | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.