28. 폼(form)객체 - 2
.NET프로그래밍/JavaScript 1.2 2009. 8. 11. 15:33 |<!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; // Summit 진행
}
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="LoginProcess.aspx" method="post" onsubmit="return CheckAgree();">
약관에 동의하시겠습니까?
<input type="checkbox" id="chkAgree" onclick="SetDis();" /> 동의함
<input type="submit" id="btnSubmit" value="회원가입페이지로 이동" />
</form>
<script>
// 기본값으로 버튼 비활성화
document.getElementById("btnSubmit").disabled = true; // 비활성화
</script>
</body>
</html>
==============================================================================================
==> LoginProcess.aspx
<%@ Page Language="C#" %>
<%
Response.Write(String.Format("아이디 : {0}<br />암호 : {1}<br />"
, Request["txtUID"], Request["txtPwd"]));
%>
<input type="button" value="뒤로" onclick="history.go(-1);" />
'.NET프로그래밍 > JavaScript 1.2' 카테고리의 다른 글
30. 자바스크립트에서 스타일시트 접근 (0) | 2009.08.11 |
---|---|
29. 드롭다운리스트체크(selectedIndex 사용) (0) | 2009.08.11 |
27. 폼(form) 객체 - 입력 값에 대한 유효성 검사 (0) | 2009.08.11 |
26. 히스토리(history) 객체 (0) | 2009.08.11 |
25. 로케이션객체 (0) | 2009.08.10 |