473,763 Members | 8,423 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 14574
You could use client-side JavaScript, with an onblur() event.

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

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


"Patrick J. Schouten" <ps***********@ hotmail.com> wrote in message
news:1b******** *************** ***@posting.goo gle.com...
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.publi c.inetserver.as p.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/vsfctformatnumb er.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="FormatT his(this);">

or call the FormatCurrency function
<INPUT type="text" name="blah"
onBlur="VBSscri pt:FormatCurren cy(no reference handy)">
GL
-----Original Message-----
Patrick J. Schouten wrote on 13 jul 2003 in
microsoft.publ ic.inetserver.a sp.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

FormatCurren cy Function
FormatNumber Function

see:

<http://msdn.microsoft.com/library/
en-us/script56/html/vsfctformatnumb er.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
2237
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 SELECT * FROM qryStatementI UNION SELECT * FROM qryStatementP ORDER BY thedate;
4
22597
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
6154
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 I do so it can shows me currency format?
8
5411
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 `'}'' 'else if (choice == 27) exit(0) } }' Here is my program (Simple loop to display currency equivalencies based
2
8847
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
3837
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 to do the formatting. For example, textbox txtAcctBalance is bound to a currency field in my dataset, and when the value shows up on the screen I want it formatted as currency ("C").
3
3084
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 Binding("Text", Me.Ds1, "Items.BidAmt") txtBidAmt.DataBindings.Add(oBidAmt) Private Sub oBidAmt_Format(ByVal sender As Object, ByVal e As System.Windows.Forms.ConvertEventArgs) Handles oBidAmt.Format
1
9412
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. In a DateTimePicker control I can set a custom format("MM/dd/yyyy"). So when I iterate through ds1 with currency manager (cma) I see the correct date format in a DateTimePicker control. Is it possible to set a custom date format like that for...
2
12512
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 decimal values, format them as currency values with a leading currency symbol and 2 decimal places. TIA Class Test
0
10002
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9938
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9823
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8822
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7368
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6643
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5406
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3917
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3528
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.