tick checkbox if database is True

froggy

Registered User.
Local time
Today, 14:47
Joined
Sep 15, 2006
Messages
13
Hi,
in my web page, i would like to user to see a ticked checkbox should the database = True however, i cannot seems to be getting it. Would anybody be able to help me out?

strSQL = "SELECT DeptHeadA FROM Employee WHERE EmpId = '" & strEmpId & "'"
nRecDHA = GetRecordset(strSQL, arrDHA)

if arrDHA(0,i) = True then
arrDHA(0,i) = "Checked"
else
arrDHA(0,i) = ""
end if

<tr>
<TD valign=top width="27%"><font size="2"><b>Department Head Alternate (1st) :</b></font></TD>
<td width="72%">
<input type="checkbox" name="DeptHeadA" value="<%=arrDHA(0,i)%>"></td>
</tr>
 
Hi,

Your problem is in the HTML

The correct syntax for a checkbox is:
<INPUT TYPE="CHECKBOX" NAME="YOURNAME" VALUE="YOURVALUE" CHECKED>

Where you have a checkbox that is 'checked' you need only include the parameter CHECKED in the tag. Leave it out for it to be unchecked.

Something like this maybe:
<input type="checkbox" name="DeptHeadA" value="DatabaseExists" <%=arrDHA(0,i)%>>

Matt.
 
Hi,

thank you. i got it =p
 

Users who are viewing this thread

Back
Top Bottom