日期:2014-05-18  浏览次数:20403 次

注册时,怎样才能在选中了服务协议的checkbox框后才能点击提交按钮?
注册时,怎样才能在选中了服务协议的checkbox框后才能点击提交按钮?
Submit提交按钮的属性
<input id="Submit2" type="submit" value="提 交" name="Submit2" runat="server" disabled>
checkbox属性
<input type="checkbox" value="ture" name="checkbox1">
怎么样才能在选中了checkbox框后才能点击提交按钮Submit2?


------解决方案--------------------
HTML code

<!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>
    <title>无标题页</title>
    <script type="text/javascript">
    function Test()
    {
        document.getElementById("Submit2").disabled = !document.getElementById("checkbox1").checked;
    }
    </script>
</head>
<body>
    注册时,怎样才能在选中了服务协议的checkbox框后才能点击提交按钮? Submit提交按钮的属性
    <input id="Submit2" type="submit" value="提 交" name="Submit2" runat="server" disabled>
    checkbox属性
    <input type="checkbox" value="ture" name="checkbox1" id="checkbox1" onclick="Test();">
</body>
</html>