473,386 Members | 1,819 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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 14559
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: DD | last post by:
I have a UnionQry that is run from StatementsI and StatementP. the Due and Paid colunms are currency and show the $ however when i union the two the currency format has gone. Any help please...
4
by: Gerry Abbott | last post by:
Hi All. How can i put a zero decimal for my currency into my format statement, == & ", for " & & " days. Cost " & Format(,"Currency") which is the data source for a textbox on a report
3
by: Claudia Fong | last post by:
Hi, My db is stored in access and I have a field amount and its type is currency. When I read from the db and display it in a textbox, it shows me 15000000 instead of $150,000.00. How can...
8
by: drose0927 | last post by:
Please help! I can't get my program to exit if the user hits the Escape button: When I tried exit(EXIT_SUCCESS), it wouldn't compile and gave me this error: Parse Error, expecting `'}''...
2
by: Juan | last post by:
I get a number from db and display it in a textbox control, how can i format the value as currency? thanks, Juan.
2
by: | last post by:
Hi all, I need to format screen output for a textbox that's bound to a datasource. I know how to format the data in a plain old string, but in this case I'm not sure where to "sneak" in there...
3
by: Slonocode | last post by:
I have some textboxes bound to an access db. I wanted to format the textboxes that displayed currency and date info so I did the following: Dim WithEvents oBidAmt As Binding oBidAmt = New...
1
by: Rich | last post by:
Hello, I have some datefields in a dataset (ds1). I bind some textbox controls on a windows form to these date fields in ds1, but I only want to see 01/01/2004 instead of 1/1/2004 8:00:00 AM. ...
2
by: AMDRIT | last post by:
Hello Everyone, I would like to format the Display Members of a combobox's datasource. Is there a way to apply a format without subclassing the original datasource? For example, given a list of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.