473,503 Members | 3,739 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Populate Textbox, VBSCRIPT

4 New Member
Hi. I'm sorry if this is a stupid question but I'm having problems populating a textbox when a button is clicked.

Example:

[HTML]<HTML>
<HEAD>
<script language="vbscript">
Sub btnCalculate_OnClick()
form.txtTotal.value = '9'
End Sub
</script>
</HEAD>

<BODY>

<form name="frmCalculation">
<input type="text" name="txtTotal">
<input type="button" name="btnCalculate" value="Calculate">
</form>

</BODY>
</HTML>[/HTML]
When I click the button, nothing happens. What is the proper procedure for populating a textbox when using a script? Thank you in advance.
May 4 '07 #1
1 6872
iskyline
13 New Member
Hi,

i think you should be showing

frmCalculation.txtTotal.value = '9'

not 100% sure but that could be the cause. :)

Hi. I'm sorry if this is a stupid question but I'm having problems populating a textbox when a button is clicked.

Example:

[HTML]<HTML>
<HEAD>
<script language="vbscript">
Sub btnCalculate_OnClick()
form.txtTotal.value = '9'
End Sub
</script>
</HEAD>

<BODY>

<form name="frmCalculation">
<input type="text" name="txtTotal">
<input type="button" name="btnCalculate" value="Calculate">
</form>

</BODY>
</HTML>[/HTML]
When I click the button, nothing happens. What is the proper procedure for populating a textbox when using a script? Thank you in advance.
May 4 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
14564
by: Patrick J. Schouten | last post by:
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,...
2
18048
by: C. David Rossen | last post by:
Hello: I have a registration form for classes. Each class has a fee. I have a drop down box whereby the user chooses his class. There is a textbox with the associated fee. I would like to...
0
1266
by: anna | last post by:
I have a grid with some columns that are BOUND columns. I have three more columns that are TEMPLATE columns with textboxes inside. i need to populate one of the textboxes with information based on...
2
6072
by: Mark | last post by:
I am attempting to populate several textbox controls from VBA code. With each attempt, I get the following error: "The macro or function set to the BeforeUpdate or ValidationRule property for...
0
1129
by: msnews | last post by:
I need to read the value typed into a textbox (textbox.txt) and then use it in some code that looks like this: Sub Button3_OnClick on error resume next dim CompName Compuser =...
2
1862
by: rt | last post by:
hi iam looking for any javascript or vbscript to add sum all the textboxes present in the datagrid. and sum must come in another total textbox. this should fire when the user enter the numeric...
2
2730
by: Junior | last post by:
Hi All, I haven't got a response for this question lately and i really need to get this done ASAP. I have a .aspx page that has table two column four rows on it. 1. How do i use codebehind C#...
4
2989
by: Mori | last post by:
I am using masterPage and I need to populate a textbox that is in a content control with data from popup page that is not part of the master page. This code works if no masterpage is involved. ...
0
1069
by: balach | last post by:
hi dear, some body please guide me in this problem that,i am using the following "vbscript" to get the free space of "C" Drive in Megabytes. when i copy this code and save as "Diskspace.vbs" then...
0
7192
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7261
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6974
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...
0
7445
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...
0
5559
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,...
1
4991
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...
0
4665
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...
0
1492
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 ...
0
369
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.