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

embed html in vbscript

Status
Not open for further replies.

craig322

MIS
Apr 19, 2001
108
US
Is there a way to do embed html in a vbscript? Here is what I have now that isn't working. What I want to do is to do the html based on the if in the vbscript.

TIA

<% if strBranch <> &quot;Plea&quot; and strBranch <> &quot; &quot; then %>

<select name=&quot;SALESMEN&quot;>
<option value=&quot;ALL&quot; selected>All Salesmen... </option>
<% do while not objRSB.eof
strValueB = &quot;**&quot; & objRSB(&quot;branch_id&quot;) & &quot; &quot; & objRSB(&quot;outside_sales_no&quot;)& &quot; &quot; & objRSB(&quot;last_name&quot;) %>
<option value=&quot;<%=trim(objRSB(&quot;outside_sales_no&quot;))%>&quot;><%=trim(objRSB(&quot;branch_id&quot;))%>&nbsp;<%=trim(objRSB(&quot;outside_sales_no&quot;))%>&nbsp;<%=trim(objRSB(&quot;last_name&quot;))%></option>
<% objRSB.MoveNext
loop
objRSB.Close %>
</select>

<% Else
objRSB.Close
End If
%>
 
Are you getting an error, is so what is the error?

I looked and I can't see why it wouldn't work.
 
craig322,

the short answer is &quot;Yes&quot;. You're not really &quot;embedding&quot; html in the VBScript. You are merely starting and/or stopping the scripted portion of the page using the script delimiters &quot;<%&quot; and &quot;%>&quot; (w/out the quotation marks of course). Example follows:

<script>
<h1>Some Headline</h1>
<% if someThing = x then %>
<p><i>Paragraph One Italicized</i></p>
<% else if someThing = y then %>
<p><b>Paragraph One Bold</b></p>
<% else %>
<p><code>Paragraph One Monospace</code><p>
<% end if %>
<p>Rest of paragraphs without style</p>

Hope that helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top