pce0
Technical User
- Jan 27, 2004
- 16
Hi,
I have an HTA that displays multiple textbox's for user input and a readonly textarea that I want to display a description of the textbox selected.
What I'm looking for is the code that will allow me to change the contents of the textarea when the textbox focus changes. For example, when textbox1 is on focus the text "this is textbox1" is displayed in the textarea, when textbox2 is on focus the text "this is the second text box" is displayed etc..
Is this possible, if so, does anyone have a code example of this or something simular?
I'm guessing I need to define the textarea text fr each input box somewhere and come up with a routine to change this when the textbox focus changes... ???
Below is the skelaton code to create the textboxs and textarea (this is just for purpose of testing):
<html>
<head>
<script language="vbscript">
sub window_onload
inputboxs=array("box1","box2","box3")
set objform=document.createElement("form")
objform.name="form1"
set objtxtarea=document.createElement("textarea")
objtxtarea.name="textarea1"
objtxtarea.value="description of selected text box"
objtxtarea.rows=10
objtxtarea.style.position="absolute"
objtxtarea.style.left="500px"
objform.appendchild objtxtarea
for each input in inputboxs
set objtxtbox=document.createElement("input")
objtxtbox.type="text"
objtxtbox.name=input
objtxtbox.size="35"
objtxtbox.style.position="absolute"
objtxtbox.style.left="200px"
objform.appendchild objtxtbox
set objbr=document.createElement("br")
objform.appendchild objbr
next
document.getelementsbytagname("body")(0).appendchild objform
end sub
</script>
</head>
<body>
</body>
I have an HTA that displays multiple textbox's for user input and a readonly textarea that I want to display a description of the textbox selected.
What I'm looking for is the code that will allow me to change the contents of the textarea when the textbox focus changes. For example, when textbox1 is on focus the text "this is textbox1" is displayed in the textarea, when textbox2 is on focus the text "this is the second text box" is displayed etc..
Is this possible, if so, does anyone have a code example of this or something simular?
I'm guessing I need to define the textarea text fr each input box somewhere and come up with a routine to change this when the textbox focus changes... ???
Below is the skelaton code to create the textboxs and textarea (this is just for purpose of testing):
<html>
<head>
<script language="vbscript">
sub window_onload
inputboxs=array("box1","box2","box3")
set objform=document.createElement("form")
objform.name="form1"
set objtxtarea=document.createElement("textarea")
objtxtarea.name="textarea1"
objtxtarea.value="description of selected text box"
objtxtarea.rows=10
objtxtarea.style.position="absolute"
objtxtarea.style.left="500px"
objform.appendchild objtxtarea
for each input in inputboxs
set objtxtbox=document.createElement("input")
objtxtbox.type="text"
objtxtbox.name=input
objtxtbox.size="35"
objtxtbox.style.position="absolute"
objtxtbox.style.left="200px"
objform.appendchild objtxtbox
set objbr=document.createElement("br")
objform.appendchild objbr
next
document.getelementsbytagname("body")(0).appendchild objform
end sub
</script>
</head>
<body>
</body>