沒有必要在所有
<%
'Have you POST to this page?
If Len(Request.Form) > 0 Then Call Save()
Sub Save()
Dim a_check, i_item, i_items
a_check = Split(Request.Form("checkbox") & "", ",")
If IsArray(a_check) Then
i_items = UBound(a_check, 1)
For i_item = 0 To i_items
'Could store this and output it later on but is just a quick example
Response.Write a_check(i_item) & " is checked"
Next
End If
End Sub
%>
<html>
<head>
</head>
<body>
<!-- make the page POST to itself -->
<form method="POST" action="">
<! -- your other fields etc
<input type="checkbox" name="checkbox" value="A" />
<input type="checkbox" name="checkbox" value="B" />
<input type="submit" value="Save" />
</form>
</body>
</html>
簡單的例子沒有什麼特別的未經檢驗的在這裏使用的任何客戶端腳本。
混合服務器端代碼與客戶端事件,呃? – Abhitalks
@konrad:現在我真的很困惑。爲什麼你從問題中刪除* classic asp *並標記兩者? Op可能已經使用*經典的asp *! – Abhitalks
我使用的是經典的asp – user3138076