Professional Web Applications Themes

Format Textbox on exit to Currency - ASP

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....

  1. #1

    Default 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.
    Patrick J. Schouten Guest

  2. #2

    Default Re: Format Textbox on exit to Currency

    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:

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

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

  3. #3

    Default Re: Format Textbox on exit to Currency

    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" <pschouten1701hotmail.com> wrote in message
    news:1b97a9cd.0307130754.23a9c488posting.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.

    Aaron Bertrand [MVP] Guest

  4. #4

    Default Re: Format Textbox on exit to Currency

    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:
    >
    ><[url]http://msdn.microsoft.com/library/[/url]
    >en-us/script56/html/vsfctformatnumber.asp>
    >
    >--
    >Evertjan.
    >The Netherlands.
    >(Please change the x'es to dots in my emailaddress)
    >.
    >
    John Ogi Guest

  5. #5

    Default Re: Format Textbox on exit to Currency

    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 [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Patrick Schouten Guest

Similar Threads

  1. Question Currency format null when = 0
    By Lulu in forum Brainstorming Area
    Replies: 0
    Last Post: November 17th, 09:49 PM
  2. format currency
    By RK in forum Microsoft SQL / MS SQL Server
    Replies: 3
    Last Post: May 15th, 06:13 PM
  3. How do I view currency field in format $xx.xx
    By Terry Murray in forum ASP Database
    Replies: 2
    Last Post: November 10th, 10:01 PM
  4. Format Currency in ASP?
    By jason in forum ASP
    Replies: 3
    Last Post: August 25th, 10:28 PM
  5. format number into currency format ($1,000,000.00)
    By Aaron Bertrand - MVP in forum Microsoft SQL / MS SQL Server
    Replies: 0
    Last Post: July 11th, 06:31 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139