Adding if condition to input tag on asp page based on data from query

I have an ASP page, display information to allow users to reserve some tickets.  I have retrieved field G1S1 from a table.  If it comes back as True, I want to display the word "Reserved", but if it is null or false, I want to display the checkbox, to allow the user to select it.  Can I do that within the html by display either a text input tag or a checkbox input tag?  i.e.:
<% If rsTickets.G1S1 = true then display input text value "Reserved" else display input checkbox %>

 <td align="center"><input type="checkbox" id="chk1" name="G1Set1" </td>
Susan FaulDatabase ProgrammerAsked:
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.

satheeshmCommented:
<% If rsTickets.G1S1 = true then response.write "Reserved" else %>

 <td align="center"><input type="checkbox" id="chk1" name="G1Set1" </td>
<% end if %>
0
Susan FaulDatabase ProgrammerAuthor Commented:
If I code this,
<td align="center" >  <% If rsTickets.Fields.Item("Game1Set1").value = true then response.write "RESERVED" else %>   <input type="checkbox" id="chk1" name="G1S1">
          <% end if %> </td>
I get the following error message,
Microsoft VBScript compilation error '800a0400'
Expected statement
Tickets.asp, line 57
end if

If I code this,
<td align="center" >  <% If rsTickets.Fields.Item("Game1Set1").value = true then response.write "RESERVED" end if %>   </td>
It works great to give me the word "RESERVED".  Somehow, putting in the else with the input tag in the middle isn't good.  

I've been playing around with it, and can't get the right combination to work.  Any suggestions?
0
satheeshmCommented:
Okay.. try this, this should work

<% If rsTickets.G1S1 = true then %>
Reserved
<% else %>
 <td align="center"><input type="checkbox" id="chk1" name="G1Set1" </td>
<% end if %>
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
Susan FaulDatabase ProgrammerAuthor Commented:
Thanks, that worked.  I appreciate the help.
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
Web Development

From novice to tech pro — start learning today.