javaScript解决Form的嵌套

时间:2022-12-31 19:22:58

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')">