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

Checkboxes

Status
Not open for further replies.

Cassien

Programmer
Joined
Sep 17, 2002
Messages
94
Looking for the code to set the default value of a checkbox - either checked or unchecked in ASP.VB is it possible? can't seem to find anywhere with any notes on it.

Details:
Looking to read a value from a database either true or false and then set a checkbox value on the record update form to be the same as the value from the database.

Thanks
 
Gave up and used an If Else loop in the end...
 
Gave up? You did it the best way you could have, sounds like to me. I don't know ASP, but in ColdFusion, the code would look something like this:
Code:
<input <cfif (#rsDatasource.Complete# EQ &quot;1&quot;)>checked</cfif> type=&quot;checkbox&quot;>
So it's really just an If tag, anyway. Don't know how you'd do it in ASP, but I hope this helps you somehow.

--Ryan
 
thanks, I think the IF loop is pretty much as good as it gets...

I was originally looking for something like

<input type=&quot;checkbox&quot; name=&quot;NoCheck&quot; value=no checked=<%=tablevalue %>>

any ideas on my new problem (see calendar(2))!!

:-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top