<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication3._Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
<script type="text/javascript">
$().ready(function() {
$('#checkbox1, #checkbox2').click(function() {
if ($('#checkbox1:checked,#checkbox2:checked').length == 2)
$('#checkbox3, #checkbox4').attr('disabled','true');
else
$('#checkbox3, #checkbox4').attr('disabled','');
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input type="checkbox" id="checkbox1" value="c1" />
<input type="checkbox" id="checkbox2" value="c2" />
<input type="checkbox" id="checkbox3" value="c3" />
<input type="checkbox" id="checkbox4" value="c4" />
</div>
</form>
</body>
</html>
這裏沒有問題。 – 2011-04-13 05:57:07
檢查我的解決方案 – 2011-04-13 06:24:52