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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTML & VBScript together.....?

Status
Not open for further replies.

madHatter1

Technical User
Feb 27, 2003
54
0
0
GB
Hello

I have a small VBScript which gives me the date at the top of my page. It is contained in a table which holds the font values, and work well.

However, because the <BODY> tag begins way down the page, I get a number of HTML errors (because the <TABLE> etc actually begins before the <BODY> tag).


<TABLE ALIGN=&quot;TOP&quot;><TR><TD><b><FONT FACE=VERDANA COLOR=#FFFFFF SIZE=1>

<%
Response.Write WriteDate (Date)

Function Suffix(number)
SELECT CASE Number
CASE 1

Function WriteDate(theDate)
WriteDate = Suffix(Day(theDate)) etc etc
%>
</FONT></b></TD></TR></TABLE>


Is there a way that I can use HTML font tags here, that is, between the <% %>, so as not to produce HTML errors?

Many thanks

Hatter
 
Yes you can response.write html, but you must use either double quotes if there is a quote in the html, or single quotes. You could also use Chr(34) in ASP to output a quote.

This tool is good for making html output in ASP, it uses double quotes.


The test should come up, just click &quot;Do it&quot; and it will out put all that html good for inside <% %> tags

- Jason

www.vzio.com
ASP WEB DEVELOPMENT
 
Hello Jason

Many thanks for your tip and the link.

It works wonders!

Hatter
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top