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

checkbox load ticked if yes/no field is yes

Status
Not open for further replies.

junglist666

Technical User
Mar 9, 2006
25
GB
Code:
<input class="txtbox" type="checkbox" name="C1" value="ON"
  <%if lcase(rsProperty("display"))="yes" then Response.write " checked " %> >

im tryin to make my checkbox be ticked if the field (yes/no datatype) is yes.

this above code produces no errors but the box isnt ticked when the page loads.. anyone know why?
 
I tend to make the value in the database either "checked" or "" and then in the checkbox us
<input class="txtbox" type="checkbox" name="C1" value="ON"
<%Response.write (rsProperty("display")) %> >

Make sure that rsProperty is returning yes when you think it is as your code should work


}...the bane of my life!
 
yes/no fields are reported back as true/false I believe


Your troubleshooting should also start with...viewing the sorce code output to see if your code is generating the correct "cehcked" value based on the rs


General FAQ faq333-2924
5 steps to asking a question faq333-3811
 
yes it was outputting true or false so i changed the yes to true and it works, thank you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top