ASP checkbox check box is selected code (combined with the database) _ Application Tips

Source: Internet
Author: User
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")%>>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.