Question
Dynamic checkbox not displaying correctly
I've been going round in circles trying to solve my problem
of dynamic checkboxes in an ASP script and I was wondering if
anyone can help me. In addition, I've read the Ultradev pages on
Adding dynamic content for checkboxes and I can't see what I'm
doing wrong.
The check box links to a Yes/No field in MS Access. I have created a filtered recordset.
I want this checkbox in a form that has an update server behavior.
The code for the checkbox that gets generated is:
<input <%If (CStr((rsViewAccess.Fields.Item("fldReadTerms").Value)) = CStr("True")) Then Response.Write("checked=""checked""") : Response.Write("")%> name="checkbox" type="checkbox" value="checkbox" checked="checked" />
However the above code doesn't display a 'check' or 'uncheck' when the content of the field in the database is 'true' or 'false' respectively. (I've added a control field to view the content of the field - this displays the content of the Yes/No field as 'true' or 'false'). Once manually checked or unchecked by the user, the checkbox updates the database correctly. The problem appears to be only with the display of the content of the Yes/No field using the checkbox.
Many thanks
Sandra
The check box links to a Yes/No field in MS Access. I have created a filtered recordset.
I want this checkbox in a form that has an update server behavior.
The code for the checkbox that gets generated is:
<input <%If (CStr((rsViewAccess.Fields.Item("fldReadTerms").Value)) = CStr("True")) Then Response.Write("checked=""checked""") : Response.Write("")%> name="checkbox" type="checkbox" value="checkbox" checked="checked" />
However the above code doesn't display a 'check' or 'uncheck' when the content of the field in the database is 'true' or 'false' respectively. (I've added a control field to view the content of the field - this displays the content of the Yes/No field as 'true' or 'false'). Once manually checked or unchecked by the user, the checkbox updates the database correctly. The problem appears to be only with the display of the content of the Yes/No field using the checkbox.
Many thanks
Sandra
