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

Working with checkboxes and database

Status
Not open for further replies.

sthmpsn1

MIS
Sep 26, 2001
456
US
I have a database where I want the box to load checked if a 1 is in the database field and unchecked if it is 0. Here is the code I am using and it doesn't work, any suggestions.

<input <% if dbrs2.Fields.Item(&quot;goalsmidsupapprove&quot;).value = &quot;1&quot; Then Response.write(&quot;1&quot;) : Response.Write(&quot;0&quot;)%> name=&quot;supercheck&quot; type=&quot;checkbox&quot; id=&quot;supercheck&quot; value=&quot;1&quot;>
 
Try this...

<input <% if dbrs2.Fields.Item(&quot;goalsmidsupapprove&quot;).value = &quot;1&quot; Then Response.write(&quot; checked&quot;) : Response.Write(&quot;&quot;)%> name=&quot;supercheck&quot; type=&quot;checkbox&quot; id=&quot;supercheck&quot; value=&quot;1&quot;>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top