怎样在form里判断执行2个action
<form method='post' name="form1">
用户名:<input type='input' name='username' value="" class='input' >
密 码:<input type='password' name='password' class='input'>
<input type="button" value="登录1" name="登录1" class="logbt" onclick="submitEvent(1)">
<input type="button" value="登录2" name="登录2" class="logbt" onclick="submitEvent(2)">
</form>
<script language="javascript">
function submitEvent(type){
if(type==1)
{
form1.action="action1url";
form1.submit();
}
if(type==2){
form1.action="action1ur2";
form1.submit();
}
}
</script>
用户名:<input type='input' name='username' value="" class='input' >
密 码:<input type='password' name='password' class='input'>
<input type="button" value="登录1" name="登录1" class="logbt" onclick="submitEvent(1)">
<input type="button" value="登录2" name="登录2" class="logbt" onclick="submitEvent(2)">
</form>
<script language="javascript">
function submitEvent(type){
if(type==1)
{
form1.action="action1url";
form1.submit();
}
if(type==2){
form1.action="action1ur2";
form1.submit();
}
}
</script>
<form method='post' name="form1">
用户名:<input type='input' name='username' value="" class='input' >
密 码:<input type='password' name='password' class='input'>
<input type="button" value="登录1" name="confirm" class="logbt" >
<input type="button" value="登录2" name="confirm" class="logbt" >
</form>
<script language="javascript" for="confirm" event="onclick">
if(event.srcElement.value=="登录1")
{
//alert(event.srcElement.value)
form1.action="action1url";
form1.submit();
} else {
form1.action="action1ur2";
form1.submit();
}
</script>
用户名:<input type='input' name='username' value="" class='input' >
密 码:<input type='password' name='password' class='input'>
<input type="button" value="登录1" name="confirm" class="logbt" >
<input type="button" value="登录2" name="confirm" class="logbt" >
</form>
<script language="javascript" for="confirm" event="onclick">
if(event.srcElement.value=="登录1")
{
//alert(event.srcElement.value)
form1.action="action1url";
form1.submit();
} else {
form1.action="action1ur2";
form1.submit();
}
</script>