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

Strange Hyperlink with conditional if then else 1

Status
Not open for further replies.

puterdude

Technical User
Apr 13, 2001
51
0
0
US
Hi,
I had some code generated by ultradev and I'm trying to put it inside a conditional statement. Because it has some asp brackets within it, I can't seem to get it to work.
This is the code:
<A HREF=&quot;allrec.asp?<%= MM_keepNone & MM_joinChar(MM_keepNone) & &quot;Qid2=&quot; & RS_password.Fields.Item(&quot;Qid2&quot;).Value%>&quot;><b>Final Review & Submit</b></A>

I'd like to be able to do this:
<% if field1 = &quot;A&quot; then
<A HREF=&quot;allrec.asp?<%= MM_keepNone & MM_joinChar(MM_keepNone) & &quot;Qid2=&quot; & RS_password.Fields.Item(&quot;Qid2&quot;).Value%>&quot;><b>Final Review & Submit</b></A>

else
response.write(&quot;You have not entered and A in field 1&quot;)
end if%>

I get an error, I believe, because of the inner bracketing.

Suggestions?

Thanks

 
I assume you know that this is Server side, not client side code. Pure HTML can't be inside <% %>. It can be inside a Response.write which is inside <% %>
Code:
<% if field1 = &quot;A&quot; then
   <A HREF=&quot;allrec.asp?<%= MM_keepNone & MM_joinChar(MM_keepNone) & &quot;Qid2=&quot; & RS_password.Fields.Item(&quot;Qid2&quot;).Value%>&quot;><b>Final Review & Submit</b></A>

else
response.write(&quot;You have not entered and A in field 1&quot;)
end if%>

should be

<% if field1 = &quot;A&quot; then ' Pure HTML follows %>
   <A HREF=&quot;allrec.asp?<%= MM_keepNone & MM_joinChar(MM_keepNone) & &quot;Qid2=&quot; & RS_password.Fields.Item(&quot;Qid2&quot;).Value%>&quot;><b>Final Review & Submit</b></A>


<%else
response.write(&quot;You have not entered and A in field 1&quot;)
end if%>
 [URL unfurl="true"]WWW.VBCompare.Com[/URL]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top