블로그 이미지
Magic_kit
study 관련자료를 한곳으로 자기 개발 목적으로 재태크 재무 관리 목적으로 일상생활의 팁을 공유 하기 위하여 블로그를 개설 하였습니다.

calendar

1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28

Category

Recent Post

Recent Comment

Archive

2009. 8. 11. 17:52 .Net Project/.Net 3.5 Sp1
반응형




<!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 CheckAgree() {
            if (document.getElementById("chkAgree").checked) {
           
                return true; //Submit 진행
            }
            else {
                alert("동의 하셔야 합니다");
                document.getElementById("chkAgree").focus();
                return false; //onsubmit 이벤트 중지
            }
        }
        //비활성화 상태에서 동의 체크 되었다면, 활성화.. 그렇지 않으면 비활성화
        function SetDis() {
            document.getElementById("btnSubmit").disabled =! document.getElementById("chkAgree").checked;
       
        }
    </script>
</head>
<body>
<form id ="Frm" name="Frm" action="form.htm" method="get"
        onsubmit="CheckAgree();">
        약간에 동의 하시겠습니까?
       <input type = "checkbox" id="chkAgree" onclick= "SetDis();" /> 동의함
       <input type ="submit" id ="btnSubmit" value = "회원가입페이지로 이동" />
</form>
<script>

    //기본값으로 버튼 비활성화
        document.getElementById("btnSubmit").disabled = true; //비활성화
      
</script>
</body>
</html>

반응형

'.Net Project > .Net 3.5 Sp1' 카테고리의 다른 글

56장 JavaScript Access(자바접근)  (0) 2009.08.11
55장 DropDownList  (0) 2009.08.11
53장 Form관련 Ex-1  (0) 2009.08.11
52장 History객체  (0) 2009.08.11
51장 Desctructor(소멸자)  (0) 2009.08.11
posted by Magic_kit