Windows Vista Forums

Textbox Refresh.
  1. #1


    Jenny White Guest

    Textbox Refresh.

    G'day to all. I have a form that has three textboxes. txt1 and txt contain values that the user enters.

    When the value in one textbox changes, I need the third one to contain the calculated value of the other two. This I can do, after the submit button is clicked.

    What I would like is when the user changes the value in txt1, the calculation is performed and the result is in tetxbox3 - I guess dynamically is the word I'm looking for.

    Does anyone have any ideas?



    thanks.

      My System SpecsSystem Spec

  2. #2


    mayayana Guest

    Re: Textbox Refresh.

    This a webpage in IE? This should work:

    ------------------------------
    <HTML>
    <HEAD>
    <TITLE></TITLE>
    <SCRIPT LANGUAGE="VBScript">
    Sub T1_onkeyup()
    AddUp
    End Sub

    Sub T2_onkeyup()
    AddUp
    End Sub

    Sub AddUp()
    Dim i1, i2
    i1 = 0
    i2 = 0
    If (Len(t1.value) > 0) And IsNumeric(T1.value) Then i1 = CLng(t1.value)
    If (Len(t2.value) > 0) And IsNumeric(T2.value)Then i2 = CLng(t2.value)
    T3.value = CStr(i1 + i2)
    End Sub
    </SCRIPT>


    </HEAD>
    <BODY BGCOLOR="#FFFFFF" TEXT="#000000">
    <INPUT ID="T1" TYPE="text"> </INPUT><BR>
    <INPUT ID="T2" TYPE="text"> </INPUT><BR>
    <INPUT ID="T3" TYPE="text"> </INPUT><BR>

    </BODY></HTML>

    ------------------------------------

    G'day to all. I have a form that has three textboxes. txt1 and txt contain
    values that the user enters.

    When the value in one textbox changes, I need the third one to contain the
    calculated value of the other two. This I can do, after the submit button is
    clicked.

    What I would like is when the user changes the value in txt1, the
    calculation is performed and the result is in tetxbox3 - I guess dynamically
    is the word I'm looking for.

    Does anyone have any ideas?

    thanks.



      My System SpecsSystem Spec

  3. #3


    Jenny White Guest

    Re: Textbox Refresh.

    Thanks for the snippet - it works as advertised. I'll have to convert to
    JavaScript so that all browsers are support (FF etc).

    I'm on the road here thanks to you and your help.

    Jenny
    "mayayana" <mayaXXyana@newsgroup> wrote in message
    news:%23xJa31egKHA.2596@newsgroup

    > This a webpage in IE? This should work:
    >
    > ------------------------------
    > <HTML>
    > <HEAD>
    > <TITLE></TITLE>
    > <SCRIPT LANGUAGE="VBScript">
    > Sub T1_onkeyup()
    > AddUp
    > End Sub
    >
    > Sub T2_onkeyup()
    > AddUp
    > End Sub
    >
    > Sub AddUp()
    > Dim i1, i2
    > i1 = 0
    > i2 = 0
    > If (Len(t1.value) > 0) And IsNumeric(T1.value) Then i1 = CLng(t1.value)
    > If (Len(t2.value) > 0) And IsNumeric(T2.value)Then i2 = CLng(t2.value)
    > T3.value = CStr(i1 + i2)
    > End Sub
    > </SCRIPT>
    >
    >
    > </HEAD>
    > <BODY BGCOLOR="#FFFFFF" TEXT="#000000">
    > <INPUT ID="T1" TYPE="text"> </INPUT><BR>
    > <INPUT ID="T2" TYPE="text"> </INPUT><BR>
    > <INPUT ID="T3" TYPE="text"> </INPUT><BR>
    >
    > </BODY></HTML>
    >
    > ------------------------------------
    >
    > G'day to all. I have a form that has three textboxes. txt1 and txt contain
    > values that the user enters.
    >
    > When the value in one textbox changes, I need the third one to contain the
    > calculated value of the other two. This I can do, after the submit button
    > is
    > clicked.
    >
    > What I would like is when the user changes the value in txt1, the
    > calculation is performed and the result is in tetxbox3 - I guess
    > dynamically
    > is the word I'm looking for.
    >
    > Does anyone have any ideas?
    >
    > thanks.
    >
    >


      My System SpecsSystem Spec

Textbox Refresh. problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
split textbox RICK VB Script 1 03 Jun 2008
no textbox for password jaap Vista account administration 2 13 Aug 2007
Textbox AutoSize? everydaypanos Avalon 1 05 Apr 2007
.NET2 TextBox & DWM Jan Kucera Aero 2 10 Dec 2006
autocomplete in a Textbox possible? Sam Jost Avalon 1 29 Sep 2006