Copy link to clipboard
Copied
Using a simple insert record then pull info from database and update record web page, however the checkboxes on the update page are not pulling the existing information from the database. The checkbox (checkbox 1,0) is writing '1' to the database when checked and the record added, but the update page does not show the checkbox to be checked on the update page.
Here is the code for the checkbox on the update page:
<input <%If (CStr((print_jobs.Fields.Item("pjVarnish").Value)) = CStr("1")) Then Response.Write("checked=""checked""") : Response.Write("")%> type="checkbox" name="pjVarnish" value="1" />
Any ideas?
Copy link to clipboard
Copied
Try this instead:
<input <%If (CStr(print_jobs.Fields.Item("pjVarnish").Value) = CStr("1")) Then Response.Write("checked") %> type="checkbox" name="pjVarnish" value="1" />
Also, why are you converting the field you are testing to a string? What is the datatype in the db? If numeric or boolean why not just:
<input <%If (print_jobs.Fields.Item("pjVarnish").Value) = 1) Then Response.Write("checked") %> type="checkbox" name="pjVarnish" value="1" />
Find more inspiration, events, and resources on the new Adobe Community
Explore Now