<script language="javascript">
function checkinput()
{
   if document.thisform.server.value=="http://www1.ab.com/login.5d"{
      location.href="http://www1.ab.com/login.5d";
   return true;
}
   if  document.thisform.server.value==="http://vip1.ab.com/login.5d"{
      location.href="http://vip1.ab.com";
    return true;
}
}
</script><html><body onsubmit="return checkinput()">
<form name="thisform"><table><tr><td>
用  户 <input type="text" name="username"><br>
密  码 <input type="password" name="pwd"><br>
服务器 <select name="server">
       <option value="http://www1.ab.com/login.5d">www1.ab.com</option>
       <option value="http://vip1.ab.com/login.5d">vip1.ab.com</option>
       </select><br>
       <input type="submit" value="OK">
</td></tr></table></form>
</html></body>仅仅供参考,我是新手,互相帮助哈!

解决方案 »

  1.   

    <form name="form1"><table><tr><td>
    用  户 <input type="text" name="username"><br>
    密  码 <input type="password" name="pwd"><br>
    服务器 <select name="server" onchange="fun(this.value)">
           <option value="http://www1.ab.com/login.5d">www1.ab.com</option>
           <option value="http://vip1.ab.com/login.5d">vip1.ab.com</option>
           </select><br>
           <input type="submit" value="OK">
    </td></tr></table></form>
    <script>
    function fun(va){doucment.form1.action=va
    document.form1.submit()}
    </script>
      

  2.   

    <form><table><tr><td>
    用  户 <input type="text" name="username"><br>
    密  码 <input type="password" name="pwd"><br>
    服务器 <select name="server" onchange="this.form.action=this.value">
           <option value="http://www1.ab.com/login.5d">www1.ab.com</option>
           <option value="http://vip1.ab.com/login.5d">vip1.ab.com</option>
           </select><br>
           <input type="submit" value="OK">
    </td></tr></table></form>简化了下~~~
      

  3.   

    读书之人 进http://community.csdn.net/Expert/topic/4008/4008443.xml?temp=.432995帮我看下