Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

printing to a text box

Status
Not open for further replies.

df75douglas

Programmer
Mar 10, 2012
1
US
Hello I would like to print the concatenation of the first 2 boxes in the 3rd, any idea what im doing wrong

<html>
<head>
<script language = "vbscript">
Dim word1, word2, result

function cmdUserInfo_OnClick()
if len(form.word1.value)<3 then
msgbox("please use atleast 3 characters in the first box")
form.word1.focus
form.word1.select
elseif len(form.word2.value) <3 then
msgbox("please use atleast 3 characters in the second box")
form.word2.focus
form.word2.select

else
response.write(form.result.value(word1 + word 2))

end if
end function
</script>
</head>
<BODY> <div align ="center">
<form name = "form" method = "post">
<table border="1">
<tr>
<td>3 Character string:</td><td><input type = "text"name = "word1" size="15"></td>
</tr>
<tr>
<td>3 Character string:</td><td><input type = "text" name = "word2" size="15"></td>
</tr>
<tr>
<td>Concatenated string:</td><td><input type = "text"name ="result" size="15"></td>
</tr>
<tr>
<td><input type = "button" name = "cmdUserInfo" value = "Summit"size="15"></td>
</tr>
</table>
</form></div>
</body>
</html>
 
This looks more like some other form of VB to me - VBScript I assume, rather than VBA. However, I guess that, in the line:

response.write(form.result.value(word1 + word 2))

what you actually wanted was:

response.write(form.result.value(word1 + word2))

Also, it may be a VBScript thing, but in VBA:

response.write(form.result.value(word1 & word2))

is better.

Tony



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top