Forum Moderators: open

Message Too Old, No Replies

help with code problem

         

lyndalouise

2:02 pm on Feb 10, 2005 (gmt 0)

10+ Year Member



I am displaying a list of locations insode a form with a checkbox after each. The problem is that I would like to put the checkbox after the location. Whatever I try I get errors - sorry I am new to asp, I'm sure this is actually quite simple! Here is the line of code, please help.

strScratch = strScratch & rstLoc("Location") & "&nbsp;<INPUT type=""checkbox"" name=""LocationID"" value=""" & rstLoc("ID") & """"

Staffa

2:16 pm on Feb 10, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The first thing that pops up is that your
<INPUT has no closing bracket >

lyndalouise

2:36 pm on Feb 10, 2005 (gmt 0)

10+ Year Member



Sorry, I didn't type all the code, my mistake -

strScratch = strScratch & rstLoc("Location") & "<INPUT type=""checkbox"" name=""LocationID"" value=""" & rstLoc("ID") & """"
If EventLinkExists("EventLocation", "LocationID", EventID, rstLoc("ID")) Then
strScratch = strScratch & " checked"
End If
strScratch = strScratch & "><br> "
rstLoc.MoveNext
Loop

mattglet

7:10 pm on Feb 10, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Please post the error you are getting.

duckhunter

2:39 pm on Feb 12, 2005 (gmt 0)

10+ Year Member



No closing bracket like Staffa said. Also the double quotes must be represented with Chr(34)

strScratch = strScratch & rstLoc("Location") & "&nbsp;<INPUT type=" & Chr(34) & "checkbox" & Chr(34) & " name=" & Chr(34) & "LocationID" & Chr(34) & " value=" & Chr(34) & rstLoc("ID") & Chr(34) & ">"