G

자바스크립트 체크 질문입니다.

1.gif
위에 사이트 처럼요...
약간에 체크안하면
개인회원가입이나. 기업회원가입을 누르면 체크해야 회원가입 할수 있습니다. 라고 하고싶습니다.
기본적으로 확인 버튼 하나만 있는데요.. 여기처럼
2개에 다 적용시킬라면 폼을 두개 만들어줘야하나요. 아니면 다른 방법이 있나요..?
...
폼처리를 안하고 자바스크립트만으로 사용할수 있는방법 혹시 잇나요..?
수고하십시요.
최강그누보드

첨부파일

1.gif (16.6 KB)
0회 2004-10-26 20:24
|

댓글 2개

감사합니다.
근데 잘안되는거 같은데요...ㅎㅎ
최강그누보드
<script>
var checkobj
function agreesubmit(el){
checkobj=el
if (document.all||document.getElementById){
for (i=0;i<checkobj.form.length;i++){
var tempobj=checkobj.form.elements[i]
if(tempobj.type.toLowerCase()=="submit")
tempobj.disabled=!checkobj.checked
}
}
}
function defaultagree(el){
if (!document.all&&!document.getElementById){
if (window.checkobj&&checkobj.checked)
return true
else{
alert("동의에 체크를 하세요.")
return false
}
}
}
</script>

여기서 부터는 <body>아래에
<form name="agreeform" onSubmit="return defaultagree(this)">
<textarea cols=40 rows=3>
위 사항에 동의하십니까?
</textarea><br>
<input name="agreecheck" type="checkbox" onClick="agreesubmit(this)">동의 합니다
<input type="Submit" value=" 확 인 " disabled>
</form>
<script>
document.forms.agreeform.agreecheck.checked=false
</script>
댓글을 작성하시려면 로그인이 필요합니다. 로그인

그누3질답

+
제목 글쓴이 날짜 조회
21년 전 조회 397
21년 전 조회 571
21년 전 조회 326
21년 전 조회 632
21년 전 조회 1,007
21년 전 조회 499
21년 전 조회 432
21년 전 조회 439
21년 전 조회 708
21년 전 조회 402
21년 전 조회 368
21년 전 조회 400
21년 전 조회 456
21년 전 조회 445
21년 전 조회 352
21년 전 조회 737
21년 전 조회 443
21년 전 조회 375
21년 전 조회 467
21년 전 조회 587
🐛 버그신고