Solved

Renaming a TextBox

Posted on 2002-04-03
5
168 Views
Last Modified: 2013-12-24
When I add a TextBox control to a HTML page and then
rename the control (id and name) from Text1 to for example
txtName in either the source windows or properties window.
If I try and reference the control txtName in a function
the control is not recognised, when you type the txtname.
the properties and methods do not display and when the
function is executed nothing happens. The control
correctly appears in the script outline.
0
Comment
Question by:dty
5 Comments
 
LVL 20

Accepted Solution

by:
hes earned 50 total points
ID: 6919001
It works when I do it. Added a textbox and a button to a blank page. Renamed Text1 to txtName. Created a function so when the button is pressed Hello will be the textbox's value.

<HTML>
<HEAD>
<META name=VI60_defaultClientScript content=VBScript>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
<SCRIPT ID=clientEventHandlersVBS LANGUAGE=vbscript>
<!--

Function button1_onclick
txtName.value = "Hello"
End Function

-->
</SCRIPT>
</HEAD>
<BODY>

<P><INPUT id=txtName name=txtName>
<INPUT id=button1 type=button value=Button name=button1></P>

</BODY>
</HTML>

Make sure you are editing in Interdev using the HTML Editor (Default)
0
 

Expert Comment

by:jumprooster
ID: 7518419
You should show your code, it could be a syntax error in your coding.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In this short web based tutorial, I wanted to show users how they can still use the powers of FrontPage in conjunction with Expression Web 3.  Even though Microsoft eliminated the use of Web components, we can still use them with FrontPage and edit …
Now that Expression Web 4.0 (http://www.microsoft.com/expression/products/Upgrade.aspx) is free if you buy or have the full version of Expression Web 3.0, now is the best time to  migrate from FrontPage to Expression Web (http://www.frontpage-to-exp…
The purpose of this video is to demonstrate how to update a WordPress Site’s version. WordPress releases new versions of its software frequently and it is important to update frequently in order to keep your site secure, and to get new WordPress…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now