Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Textbox Refresh.

4 views
Skip to first unread message

Jenny White

unread,
Dec 20, 2009, 9:12:03 PM12/20/09
to
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.

mayayana

unread,
Dec 20, 2009, 10:28:37 PM12/20/09
to
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>

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

Jenny White

unread,
Dec 20, 2009, 10:47:42 PM12/20/09
to
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" <mayaX...@rcXXn.com> wrote in message
news:%23xJa31e...@TK2MSFTNGP04.phx.gbl...

0 new messages