zoukankan
html css js c++ java
怎样在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
>
<
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
>
查看全文
相关阅读:
今天试了下lockerz,感觉国外的概念很先进
十月一日,本人就结婚了,我和老婆选的婚礼主题曲,大家听听
今天遇到了个奇怪的问题
第一个博客,第一次随笔
遇到一个奇葩的问题,could not load the assembly file XXX downloaded from the Web
Log4net简单使用
AutoWCFService心跳动态加载服务
初学Service Broker
新浪SAE云空间和SVN版本控制
软件工程导论第一次作业
原文地址:https://www.cnblogs.com/starm/p/906811.html
最新文章
SpringBoot2.2.0 Release版本发行特性
聊聊Spring Cloud Gateway网关路由
ShardingJDBC 垂直拆分(不同的表在不同的库中)
Spring Boot版 Sharding JDBC 垂直拆分(不同的表在不同的库中)+ 读写分离
软件工程个人作业——词频统计
热门软件创新分析
《人月神话》读书笔记(2)week3
词频分析项目报告
《程序员思维修炼》读书笔记——week4
第五周读书笔记
热门文章
Serializable 和 Parcelable 区别
Android开发指南中文版(十四)User InterfaceBinding to Data with AdapterView
Android开发指南中文版(八)User Interface
Windows环境下Android Sdk源码下载
Android开发指南中文版(十二)User InterfaceDialogs
Android开发指南中文版(十一)User InterfaceMenus
Android开发指南中文版(九)User InterfaceXML Layouts
Android开发指南中文版(十)User InterfaceInput Events
Android开发指南中文版(十三)User InterfaceNotifications
Hierarchy Viewer Tool
Copyright © 2011-2022 走看看