form 의 action 필드를 전환하는 방법
<script type="text/javascript">
function OnSubmitForm()
{
if(document.pressed == 'Insert')
{
document.myform.action ="insert.html";
}
else if(document.pressed == 'Update')
{
document.myform.action ="update.html";
}
return true;
}
</script>
<form name="myform" onsubmit="return onsubmitform();">
<input type="submit" name="operation" onclick="document.pressed=this.value" value="insert" />
<input type="submit" name="operation" onclick="document.pressed=this.value" value="update" />
</form>
function OnSubmitForm()
{
if(document.pressed == 'Insert')
{
document.myform.action ="insert.html";
}
else if(document.pressed == 'Update')
{
document.myform.action ="update.html";
}
return true;
}
</script>
<form name="myform" onsubmit="return onsubmitform();">
<input type="submit" name="operation" onclick="document.pressed=this.value" value="insert" />
<input type="submit" name="operation" onclick="document.pressed=this.value" value="update" />
</form>
|
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기
댓글 7개
... 잠깐 사이에 그 전게시물이 삭제되었더러구요 .... 싱고보류 ~~~
헉 신고 할려니 활동지수 1점 부족 ㅠ.ㅠ
그래도 1회 추천은 제가 했다는거.... --ㅋ
이러면 또 링크 오작동 발령이군요 .... 에효 ....
대신 리자님 코드 날로 먹기 모드 ^^;;
-----------------------------------------------------------
<script>
function rtcheckfrm() {
var frm = document.mms80form;
if (frm.yayak[1].checked){
frm.action = "./Upload2";
} else {
frm.action = "./Upload";
}
return true;
document.form.submit();
}
</script>
<FORM name=mms80form enctype="multipart/form-data" method="post" onSubmit="return rtcheckfrm();">
필요폼 내용들.....
<input type="radio" name="yayak" value="0" checked> 즉시
<input type="radio" name="yayak" value="1"> 예약
<input type='image' src="img/sms/mobil_send.gif" name='Send' title="전송할려면 눌러유~~~">
</FORM>
이렇게 하시면 1개의 submit 문으로 -_-;;; radjo 버턴으로 대처하실수 있을듯 합니다..
http://sir.co.kr/bbs/board.php?bo_table=tiptech&wr_id=11961