九游青云决手游官网:选择单选使form链接至不同页面,怎么实现!!!急急急啊!!!

来源:百度文库 编辑:查人人中国名人网 时间:2024/05/14 06:46:00
<form id="form1" name="form1" method="post" action="login.asp">
<input name="usertype" type="radio" value="stu" checked>学生
<input type="radio" name="usertype" value="admin">管理员
<input name="login" type="submit" class="main" value="登录" onFocus="this.blur()"/>
</form>
我想选择学生的时候,链接到login.asp,选择管理员的时候,链接到admin.asp
请各位高手帮帮忙啊,谢谢了,急急急啊!!!
<script language="JavaScript" type="text/JavaScript">
function go(){
if(document.form1.usertype.item(0).checked)
{
document.form1.action="login.asp";
document.form1.submit();
}
else
{
document.form1.action="admin/admin.asp";
document.form1.submit();
}
}
</script>

<form id="form1" name="form1" method="post" >
<input name="usertype" type="radio" value="stu" checked>学生
<input name="usertype" type="radio" value="admin" >管理员
<input name="login" type="button" value="登录" onClick="go()">
</form>

action="123.asp"
123.asp代码:
<% if request.form("usertype")="stu" then
response.redirect "login.asp"
else
response.redirect "admin.asp"
end if
%>