submit > 스크립트 실행 문의 채택완료
</p>
<p><form method="post" enctype="multipart/form-data" onsubmit="return change()">
<div id="ModalWindow" class="mw">
<div class="bg"><!--이란에는 내용을 넣지 마십시오.--></div>
<div class="fg">
<label class="btn1"><b>❗ 정보변경이 감지되었습니다. ❗</b></label>
정확한 정보를 선택해주세요.
<label>
<input style="font-size: 1em; margin: 0px 0px 4px 5px" type="radio" name="choi" value="1" checked="checked">변경된 (<?=$pay_office?>/<?=$pay_bus_no?>/<?=$jo?>)
</label>
<label>
<input style="font-size: 1em; margin: 0px 0px 4px 5px" type="radio" name="choi" value="2">변경전 (<b><?=$office?>/<?=$bus_no?>/<?=$jo?></b>)
</label>
<a href="업무정보수정.php?id=<?=$id?>">⚪ 직접수정</a>
<button class="mwCloseBtn" type="submit">
<span style="font-size: 16px;">확인</span></button>
</div>
</div>
</form></p>
<p>
<script></p>
<p>function change() {
if(form.choi.value == "1") {
alert("회원 정보를 수정합니다.");
}
if(form.choi.value == "2") {
alert("변경하지 않습니다.");
}
document.getElementById('ModalWindow').style.display='none';
}</p>
<p></script>
모달창을 띄워서 정보 수정을 하게끔 하려는 코드입니다.
위 코드를 실행하면 alert이 뜨질 않습니다.
버튼에 onclick="change()" 해도 마찮가지 인데...
버튼 클릭하면 디비수정하고 모달 닫으려는데 change()로 넘기는게 안됩니다.
어디가 문제인지...
댓글을 작성하려면 로그인이 필요합니다.
답변 3개
채택된 답변
+20 포인트
2년 전
form 의 정의가 없자나요...
function change() {
var form = document.Mform;
if(form.choi.value == "1") {
alert("회원 정보를 수정합니다.");
}
if(form.choi.value == "2") {
alert("변경하지 않습니다.");
}
document.getElementById('ModalWindow').style.display='none';
}
로 변경해 보세요
로그인 후 평가할 수 있습니다
댓글을 작성하려면 로그인이 필요합니다.
댓글을 작성하려면 로그인이 필요합니다.
2년 전
방식을
1. 수정을 ajax로 하신후에 경고창을 띄우시거나
2. alert를 수정이 되는 페이지에서 띄우도록
변경하시면 됩니다.
로그인 후 평가할 수 있습니다
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인전체 질문 목록
답변대기
답변대기
답변대기
답변대기
답변대기
답변대기
답변대기
답변대기
채택
답변대기
답변대기
답변대기
답변대기
채택
채택
답변대기
답변대기
답변대기
채택