fvnnmike
-
Total Posts
:
4
- Scores: 0
-
Reward points
:
0
- Joined: 5/17/2005
- Location: Australia
-
Status: offline
|
how to fill the textbox
Tuesday, May 17, 2005 4:48 PM
( permalink)
hey there i got this problem here, wish you could help :) I got a price list with the checkbox next to the item price. All I wanna do is to calculatethe total using textbox which could automatically filled in when you tick the checkbox on the item price. Every single help would be appreciated.
Thank You For Your Help :D GBU
|
|
|
|
crazymatt
-
Total Posts
:
310
- Scores: 0
-
Reward points
:
0
- Joined: 3/4/2005
- Location:
-
Status: offline
|
Re: how to fill the textbox
Tuesday, May 17, 2005 7:55 PM
( permalink)
|
|
|
|
Zifter
-
Total Posts
:
315
- Scores: 0
-
Reward points
:
0
- Joined: 1/5/2005
- Location: Belgium
-
Status: offline
|
Re: how to fill the textbox
Tuesday, May 17, 2005 8:18 PM
( permalink)
Are you in the same class as ishah? ([url="http://www.visualbasicscript.com/topic.asp?TOPIC_ID=2969"]topic[/url],[url="http://www.visualbasicscript.com/topic.asp?TOPIC_ID=2995"]topic[/url]) Anyhow, here's a little example which should gets you started: <html>
<head>
<script language=VbScript>
Function MyBooks_OnClick
MyBooks.Total.Value = 0
For i = 1 To 5
Set tmpBook = MyBooks("Book" & CStr(i))
If tmpBook.Checked Then
MyBooks.Total.Value = CInt(MyBooks.Total.Value) + CInt(tmpBook.Value)
End If
Set tmpBook = Nothing
Next
End Function
</script>
</head>
<body>
<form name=MyBooks>
<input type=checkbox name=Book1 value=10>Book1 (price: 10)</input><br>
<input type=checkbox name=Book2 value=20>Book2 (price: 20)</input><br>
<input type=checkbox name=Book3 value=30>Book3 (price: 30)</input><br>
<input type=checkbox name=Book4 value=40>Book4 (price: 40)</input><br>
<input type=checkbox name=Book5 value=50>Book5 (price: 50)</input><br>
<input type=text name=Total value=0>
</form>
</body>
</script>
HTH
|
|
|
|