form action 정보
form action
본문
http://sir.co.kr/bbs/board.php?bo_table=g4_qa&wr_id=112214&page=2
에서 sjsjin님의 답변을 받아보고 return false; 해주었는데도 역시나
form action에 할당된 페이지로 이동을 합니다.ㅡㅜ
------------------------ 전 --- 체 --- 코 --- 드 ----------------------------------------
<script language='javascript'>
function onenter() {
if ( event.keyCode == 13 ) {
checkInput();
}
}
function checkInput(){
var f = document.signform;
if (!f.pw2.value){
alert("비밀번호를 입력하세요");
f.pw2.focus();
return false;
}
else if (f.pw2.value != f.pw1.value){
alert("비밀번호가 다릅니다. 고객센터로 문의해주세요");
f.pw2.focus();
return false;
}
else{
f.submit();
}
}
</script>
<form name="signform" method="post" action="test.html">
<input type="hidden" name="pw1" value="<?=$config['cf_1'];?>">
<input type="text" name="pw2" onKeyDown="onenter();">
<input type="button" onClick="checkInput(this.form)">
</form>
에서 sjsjin님의 답변을 받아보고 return false; 해주었는데도 역시나
form action에 할당된 페이지로 이동을 합니다.ㅡㅜ
------------------------ 전 --- 체 --- 코 --- 드 ----------------------------------------
<script language='javascript'>
function onenter() {
if ( event.keyCode == 13 ) {
checkInput();
}
}
function checkInput(){
var f = document.signform;
if (!f.pw2.value){
alert("비밀번호를 입력하세요");
f.pw2.focus();
return false;
}
else if (f.pw2.value != f.pw1.value){
alert("비밀번호가 다릅니다. 고객센터로 문의해주세요");
f.pw2.focus();
return false;
}
else{
f.submit();
}
}
</script>
<form name="signform" method="post" action="test.html">
<input type="hidden" name="pw1" value="<?=$config['cf_1'];?>">
<input type="text" name="pw2" onKeyDown="onenter();">
<input type="button" onClick="checkInput(this.form)">
</form>
댓글 전체
return false; 를 exit;로 해주시면 어떨까요 (직접해보지 않고 답변드려 죄송합니다)

그래도 action에 할당된 페이지로 이동을 하네요 ㅡㅜ