ASP reads the code from the database to read whether the check box is selected. Sometimes, we will use check boxes in web pages, that is, multi-select boxes. When the user submits input information, we will obtain the content of the check box. , and then save it to the database, such as the personal information entered by the user. However, when the user submits, it may need to be modified. Then we have to read the form data from the database, which requires that the status previously entered by the user must be displayed. However, when we read from the database whether the check box has been It is indeed difficult to achieve when selected. So today I will teach you how to read out whether the check box is selected from the database through ASP. I hope friends who have other methods can leave a message to share.
The specific code is as follows:
Copy the code code as follows:
<%
document=Split(rs(document),,) 'The comma here depends on the separator you saved to the database before
Function check(temp)
check=
For I=0 To UBound(document)
if temp=document(I) Then
check=checked
End if
Next
End Function
%>
<input name=checkbox type=checkbox value=asp <%=check(asp)%>>
<input name=checkbox type=checkbox value=java <%=check(java)%>>
<input name=checkbox type=checkbox value=php <%=check(php)%>>