checkbox

D

Darren Spooner

i have a update page the pulles date form a database. and two the these
fields have Y or N in them and if the RS("Value") = Y the i want the
checkbox to be checked how do i do this??
 
K

Ken Schaefer

<% If objRS("Value") = "Y" then %>
<input type="checkbox" name="chk1" value="hello" checked>
<% Else %>
<input type="checkbox" name="chk1" value="hello">
<%End If %>

is one way.

Another way would be:

<%
strChecked = ""
If objRS("Value") = "Y" then strChecked = "checked"
%>

<input type="checkbox" name="chk1" value="hello" <%=strChecked%>>

Cheers
Ken


: i have a update page the pulles date form a database. and two the these
: fields have Y or N in them and if the RS("Value") = Y the i want the
: checkbox to be checked how do i do this??
:
:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,277
Latest member
VytoKetoReview

Latest Threads

Top