-1

I'm trying to create a sub function in classic asp that shows Password: the text space ? Any suggestions?

Sub GetPassword()
   response.write " Password:"
   <input type="text" name="txtEmPwd" size="20" value="<%=strEmPwd%>">&nbsp;&nbsp;1st 3 chars of 
   last name&nbsp;<input type="text" name="txtFirst3" size="5" maxlength=3 value="<%=strFirst3%>"> 
end sub

I get an error where the greater than character

Microsoft VBScript compilation error '800a0400'

Expected statement

  • Does this answer your question? [Can I return html from a classic asp vbscript asp function? What about PHP?](https://stackoverflow.com/questions/8043508/can-i-return-html-from-a-classic-asp-vbscript-asp-function-what-about-php) – user692942 Apr 14 '21 at 08:14

1 Answers1

0

That's because you are writing html directly in server side code. You have to add the html as a string, something like this:

Sub GetPassword()
   dim html
   html = "Password:"
   html = html & "<input type='text' name='txtEmPwd' size='20' value='" & strEmPwd & "'>&nbsp;&nbsp;1st 3 chars of last name&nbsp;"
   html = html & "<input type='text' name='txtFirst3' size='5' maxlength='3' value='" & strFirst3 & "'>"
   Response.Write html
end sub
Machavity
  • 30,841
  • 27
  • 92
  • 100