<html>
 <head>

  <script language="javascript">
   function ExemSubmit( str )
   {
    //document.exem.method              = "post";                    //아래 form tag에 적어두었으면 적을 필요 없음.
    document.exem.action                    = "URL or Page";       //아래 form tag와 중복 된다면 전송이 잘 이루어지지 않는다.
    document.exem.postparameter.value = "xxxx";                  //PageMode와 같은 파라메터 값을 지정하여 전송할 수 있다.
   
    //str변수를 받아 사용할 수 있다.
   }
   
   function chkForm()
   {
    //여기에 폼을 submit할 때 체크해야하는 로직을 적으세요//
   }
  </script>
 </head>
 
 
 <body>
  <form id="exem" name="exem" method="post" action="xxx.jsp" onsubmit="return chkForm();">
   <input type='button' name='insert' value='저장' onClick='JavaScript:ExemSubmit("Insert")'>&nbsp;
   <input type='button' name='update' value='수정' onClick='JavaScript:ExemSubmit("Update")'>&nbsp;
   <input type='button' name='delete' value='삭제' onClick='JavaScript:ExemSubmit("Delete")'>
   
   <!-- 위의 form tag에 전송할 것들을 모두 적어 두었다면 아래와 같이 submit할 수 있다.
   <input type='button' name='directSubmit' value='바로 전송' onClick='document.exem.submit()'>
   -->
  </form>
 </body>
</html>

+ Recent posts