Help with syntax in inserting html code in ASP sentence

I need to be able to insert html code within an ASP sentence
I need to insert this:

<form>

<td>
	<select name="Checked-In" size="1" style="width: 80px">
	<option value="Yes">Yes</option>
	<option value="No">No</option>
	</select>
</td>


</form>


ON THE LAST LINE OF THE BELOW CODE:

    <%

Response.Write "<td width='10%'>" & myRecordSet("Source") & "</td>" & _
    "<td width='15%'>" & myRecordSet("LastName") & "</td>" & _
    "<td width='15%'>" & myRecordSet("FirstName") & "</td>" & _
    "<td width='20%'>" & myRecordSet("Title") & "</td>" & _
    "<td width='10%'>" & myRecordSet("ColorCode") & "</td>" & _
	"<td width='20%'>" & myRecordSet("CheckedIn") & "</td>" & _
	
"</tr>" & vbNewLine
	
	
%>

What is the correct syntax?

Open in new window

vicvillageAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

nap0leonCommented:
Easier way - get rid of all that "response.write" stuff.  

%>
<td width='10%'><%=myRecordSet("Source")%></td>
<td width='15%'><%=myRecordSet("LastName")%></td>
<td width='15%'><%=myRecordSet("FirstName")%></td>
<td width='20%'><%=myRecordSet("Title")%></td>
<td width='10%'><%=myRecordSet("ColorCode")%></td>
<td width='20%'><%=myRecordSet("CheckedIn")%></td>
</tr>
%>

Open in new window


I'm not sure how your form fits into the above... but by closing your ASP when you want to output HTML, you get to avoid worrying about your " and ' getting in the way.  Just use <%=variableName%> wherever you want to reference an ASP variable.

So...
Write your HTML the way it should look, then drop your ASP variables into place using <%=variableName%>.  This makes it much easier to read.
0
nap0leonCommented:
oops... code above has a %> instead of a <% at the end.

%>
<td width='10%'><%=myRecordSet("Source")%></td>
<td width='15%'><%=myRecordSet("LastName")%></td>
<td width='15%'><%=myRecordSet("FirstName")%></td>
<td width='20%'><%=myRecordSet("Title")%></td>
<td width='10%'><%=myRecordSet("ColorCode")%></td>
<td width='20%'><%=myRecordSet("CheckedIn")%></td>
</tr>
<%

Open in new window


If you want the last TD to be the select box and the value for <%=myRecordSet("CheckedIn")%> is a "Yes" or "No", then you could do it like this:

<td width='20%'>
	<select name="Checked-In" size="1" style="width: 80px">
	<option value="Yes" <% If myRecordSet("CheckedIn" = "Yes" Then%>SELECTED<%End If%> >Yes</option>
	<option value="No" <% If myRecordSet("CheckedIn" = "No" Then%>SELECTED<%End If%> >No</option>
	</select>
</td>

Open in new window

0
nap0leonCommented:
Sorry for spam - last bit is missing a closing )

<td width='20%'>
	<select name="Checked-In" size="1" style="width: 80px">
	<option value="Yes" <% If myRecordSet("CheckedIn") = "Yes" Then%>SELECTED<%End If%> >Yes</option>
	<option value="No" <% If myRecordSet("CheckedIn") = "No" Then%>SELECTED<%End If%> >No</option>
	</select>
</td>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
vicvillageAuthor Commented:
Thank you, that made it better. I'm posting another question perhaps you can help me on that as well. It should be live in 5 mins.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.