javaScript解决Form的嵌套

 HTML是不允许FORM嵌套的,用一个简单的JAVASCRIPT就可以解决问题了   

  <script   language=javascript>   
  function   process(v){   
  if(v=="in"){   
  document.theForm.action="in.jsp";   
  }else{   
  document.theForm.action="out.jsp";   
  }   
  document.theForm.submit();   
  }   
  </script>   
    
  <form   name=theForm   method=post>   
  <input   type=text   name=username>   
  <input   type=text   name=password>   
  <input   type=button   name=login   value=LOGIN   onclick="process('in')">   
  <input   type=button   name=logout   value=LOGOUT   onclick="process('out')">   

 

posted on 2016-08-17 11:25  让编程成为一种习惯  阅读(180)  评论(0编辑  收藏  举报