Sometimes we use a check box in a Web page, which is a marquee, when the user submits the input, we get the contents of the check box, and then we save it to the database, such as the personal information entered by the user. However, when users may need to modify the submission, then we will read the form data from the database, which requires that the user input before the state to display, but when we read out from the database check box is selected when it is hard to achieve. So today I would like to teach you through ASP from the database to read out the check box is selected method, I hope there are other methods of friends message sharing.
The specific code looks like this:
Copy Code code as follows:
<%
Document=split (RS ("document"), ",") ' Here the comma depends on the delimiters you saved to the database
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")%>>