- 浏览: 980104 次
- 性别:
- 来自: 山西
文章分类
最新评论
-
白小默:
你好 可以提供下源码DEMO吗,不知为何,我导出来的excel ...
jxls 使用模板文件导出生成excel -
zkzqzzz:
博主威武!
让微信二维码扫描您的APK -
zkzqzzz:
感谢博主 原来那些类都不是必须的 或者自己写!!博主真棒 ...
抢红包插件实现原理浅析 -
zkzqzzz:
博主 请问你的其他类在哪里呢?
抢红包插件实现原理浅析 -
zkzqzzz:
其他类在哪呢?
抢红包插件实现原理浅析
用javaScript动态修改html组件form的action属性,可以在提交时再决定处理表单的页面。
Js代码 < type="application/x-shockwave-flash" width="14" height="15" src="http://wjt276.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf" src="http://wjt276.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf" flashvars="clipboard=%3Cscript%3E%0A%20%20%3C!--%0A%20%20function%20chgAction(v)%7B%0A%20%20%20if(v%3D%3D1)%7B%0A%20%20%20%20form1.action%3D%22.%2Fnewworksheet%22%3B%0A%20%20%20%7Delse%20if(v%3D%3D2)%7B%0A%20%20%20%20form1.action%3D%22.%2Fworksheetupdate%22%3B%0A%20%20%20%7D%0A%20%20%20form1.submit()%3B%0A%20%20%7D%0A%20%20--%3E%0A%3C%2Fscript%3E" quality="high" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="14" height="15">
<script>
<!--
function chgAction(v){
if (v==1){
form1.action="./newworksheet" ;
}else if (v==2){
form1.action="./worksheetupdate" ;
}
form1.submit();
}
-->
</script>
<script>
<!--
function chgAction(v){
if(v==1){
form1.action="./newworksheet";
}else if(v==2){
form1.action="./worksheetupdate";
}
form1.submit();
}
-->
</script>Html代码 < type="application/x-shockwave-flash" width="14" height="15" src="http://wjt276.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf" src="http://wjt276.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf" flashvars="clipboard=%3Cform%20method%3D%22post%22%20name%3D%22form1%22%20action%3D%22%22%3E%0A%3Cinput%20name%3D%22worker%22%20type%3D%22text%22%20size%3D%2250%22%20value%3D%22%22%20%2F%3E%0A%3Cinput%20type%3D%22submit%22%20value%3D%22%E6%B7%BB%E5%8A%A0%22%20name%3D%22add%22%20onclick%3D%22chgAction(1)%3B%22%20%2F%3E%0A%3Cinput%20type%3D%22submit%22%20value%3D%22%E4%BF%AE%E6%94%B9%22%20name%3D%22update%22%20onclick%3D%22chgAction(2)%3B%22%20%2F%3E%0A%3C%2Fform%3E" quality="high" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="14" height="15">
< form method = "post" name = "form1" action = "" >
< input name = "worker" type = "text" size = "50" value = "" />
< input type = "submit" value = "添加" name = "add" onclick = "chgAction(1);" />
< input type = "submit" value = "修改" name = "update" onclick = "chgAction(2);" />
</ form >
<form method="post" name="form1" action="">
<input name="worker" type="text" size="50" value="" />
<input type="submit" value="添加" name="add" onclick="chgAction(1);" />
<input type="submit" value="修改" name="update" onclick="chgAction(2);" />
</form>
============================================================================
Js代码 < type="application/x-shockwave-flash" width="14" height="15" src="http://wjt276.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf" src="http://wjt276.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf" flashvars="clipboard=%3Cscript%20language%3D%22JavaScript%22%20%3E%20%0Afunction%20checkaction(v)%7B%20%0Aif(v%3D%3D0)%7B%20%0Adocument.dbform.action%3D%22index.php%3Fadmin_db-repair%22%3B%20%0A%7Delse%7B%20%0Adocument.dbform.action%3D%22index.php%3Fadmin_db-optimize%22%3B%20%0A%7D%20%0Adbform.submit()%3B%20%0A%7D%20%0A%0A%3C%2Fscript%3E%20%0A%0A" quality="high" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="14" height="15">
<script language= "JavaScript" >
function checkaction(v){
if (v==0){
document.dbform.action="index.php?admin_db-repair" ;
}else {
document.dbform.action="index.php?admin_db-optimize" ;
}
dbform.submit();
}
</script>
<script language="JavaScript" >
function checkaction(v){
if(v==0){
document.dbform.action="index.php?admin_db-repair";
}else{
document.dbform.action="index.php?admin_db-optimize";
}
dbform.submit();
}
</script>
Html代码 < type="application/x-shockwave-flash" width="14" height="15" src="http://wjt276.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf" src="http://wjt276.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf" flashvars="clipboard=%26nbsp%3B%26nbsp%3B%3Cform%20action%3D%22%22%20method%3D%22post%22%20name%3D%22dbform%22%3E%26nbsp%3B%0A%3Cinput%20type%3D%22submit%22%20class%3D%22btn%22%20value%3D%22%7Blang%20dbStartOptimize%7D%22%20name%3D%22opsubmit%22%20onclick%3D%22checkaction(1)%3B%22%20%2F%3E%20%0A%20%3Cinput%20type%3D%22submit%22%20class%3D%22btn%22%20value%3D%22%7Blang%20dbStartFix%7D%22%20name%3D%22resubmit%22%20onclick%3D%22checkaction(0)%3B%22%20%2F%3E%20%0A%3C%2Fform%3E%20%0A" quality="high" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="14" height="15">
< form action = "" method = "post" name = "dbform" >
< input type = "submit" class = "btn" value = "{lang dbStartOptimize}" name = "opsubmit" onclick = "checkaction(1);" />
< input type = "submit" class = "btn" value = "{lang dbStartFix}" name = "resubmit" onclick = "checkaction(0);" />
</ form >
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/xingming_03/archive/2010/07/14/5735064.aspx
Js代码 < type="application/x-shockwave-flash" width="14" height="15" src="http://wjt276.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf" src="http://wjt276.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf" flashvars="clipboard=%3Cscript%3E%0A%20%20%3C!--%0A%20%20function%20chgAction(v)%7B%0A%20%20%20if(v%3D%3D1)%7B%0A%20%20%20%20form1.action%3D%22.%2Fnewworksheet%22%3B%0A%20%20%20%7Delse%20if(v%3D%3D2)%7B%0A%20%20%20%20form1.action%3D%22.%2Fworksheetupdate%22%3B%0A%20%20%20%7D%0A%20%20%20form1.submit()%3B%0A%20%20%7D%0A%20%20--%3E%0A%3C%2Fscript%3E" quality="high" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="14" height="15">
<script>
<!--
function chgAction(v){
if (v==1){
form1.action="./newworksheet" ;
}else if (v==2){
form1.action="./worksheetupdate" ;
}
form1.submit();
}
-->
</script>
<script>
<!--
function chgAction(v){
if(v==1){
form1.action="./newworksheet";
}else if(v==2){
form1.action="./worksheetupdate";
}
form1.submit();
}
-->
</script>Html代码 < type="application/x-shockwave-flash" width="14" height="15" src="http://wjt276.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf" src="http://wjt276.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf" flashvars="clipboard=%3Cform%20method%3D%22post%22%20name%3D%22form1%22%20action%3D%22%22%3E%0A%3Cinput%20name%3D%22worker%22%20type%3D%22text%22%20size%3D%2250%22%20value%3D%22%22%20%2F%3E%0A%3Cinput%20type%3D%22submit%22%20value%3D%22%E6%B7%BB%E5%8A%A0%22%20name%3D%22add%22%20onclick%3D%22chgAction(1)%3B%22%20%2F%3E%0A%3Cinput%20type%3D%22submit%22%20value%3D%22%E4%BF%AE%E6%94%B9%22%20name%3D%22update%22%20onclick%3D%22chgAction(2)%3B%22%20%2F%3E%0A%3C%2Fform%3E" quality="high" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="14" height="15">
< form method = "post" name = "form1" action = "" >
< input name = "worker" type = "text" size = "50" value = "" />
< input type = "submit" value = "添加" name = "add" onclick = "chgAction(1);" />
< input type = "submit" value = "修改" name = "update" onclick = "chgAction(2);" />
</ form >
<form method="post" name="form1" action="">
<input name="worker" type="text" size="50" value="" />
<input type="submit" value="添加" name="add" onclick="chgAction(1);" />
<input type="submit" value="修改" name="update" onclick="chgAction(2);" />
</form>
============================================================================
Js代码 < type="application/x-shockwave-flash" width="14" height="15" src="http://wjt276.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf" src="http://wjt276.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf" flashvars="clipboard=%3Cscript%20language%3D%22JavaScript%22%20%3E%20%0Afunction%20checkaction(v)%7B%20%0Aif(v%3D%3D0)%7B%20%0Adocument.dbform.action%3D%22index.php%3Fadmin_db-repair%22%3B%20%0A%7Delse%7B%20%0Adocument.dbform.action%3D%22index.php%3Fadmin_db-optimize%22%3B%20%0A%7D%20%0Adbform.submit()%3B%20%0A%7D%20%0A%0A%3C%2Fscript%3E%20%0A%0A" quality="high" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="14" height="15">
<script language= "JavaScript" >
function checkaction(v){
if (v==0){
document.dbform.action="index.php?admin_db-repair" ;
}else {
document.dbform.action="index.php?admin_db-optimize" ;
}
dbform.submit();
}
</script>
<script language="JavaScript" >
function checkaction(v){
if(v==0){
document.dbform.action="index.php?admin_db-repair";
}else{
document.dbform.action="index.php?admin_db-optimize";
}
dbform.submit();
}
</script>
Html代码 < type="application/x-shockwave-flash" width="14" height="15" src="http://wjt276.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf" src="http://wjt276.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf" flashvars="clipboard=%26nbsp%3B%26nbsp%3B%3Cform%20action%3D%22%22%20method%3D%22post%22%20name%3D%22dbform%22%3E%26nbsp%3B%0A%3Cinput%20type%3D%22submit%22%20class%3D%22btn%22%20value%3D%22%7Blang%20dbStartOptimize%7D%22%20name%3D%22opsubmit%22%20onclick%3D%22checkaction(1)%3B%22%20%2F%3E%20%0A%20%3Cinput%20type%3D%22submit%22%20class%3D%22btn%22%20value%3D%22%7Blang%20dbStartFix%7D%22%20name%3D%22resubmit%22%20onclick%3D%22checkaction(0)%3B%22%20%2F%3E%20%0A%3C%2Fform%3E%20%0A" quality="high" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" width="14" height="15">
< form action = "" method = "post" name = "dbform" >
< input type = "submit" class = "btn" value = "{lang dbStartOptimize}" name = "opsubmit" onclick = "checkaction(1);" />
< input type = "submit" class = "btn" value = "{lang dbStartFix}" name = "resubmit" onclick = "checkaction(0);" />
</ form >
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/xingming_03/archive/2010/07/14/5735064.aspx
发表评论
-
npm介绍与cnpm介绍
2017-12-07 15:22 390npm介绍 说明:npm(nod ... -
Electron学习笔记Part3-利用Electron builder应用打包EXE
2017-12-06 17:44 1241HelloWorld写完并能够成功运行了,接下来将这个He ... -
利用electron-packager打包exe程序
2017-12-06 17:41 952一、安装 electron-packager PS:安装之 ... -
使用npm安装electron不成功的解决方法
2017-12-06 17:24 3166使用npm安装electron不成功的解决方法 根据官网提 ... -
electron 的混合桌面之路 入门安装
2017-12-06 17:23 682最近有计划去写桌面程序,所以呢,我打算写一篇博客来记录 ... -
formValidator的一些验证实例
2016-12-21 11:14 403$(function () { try { ... -
JS中onmouseover与onmouseout的bug/js避免onmouseover onmouseout多次触发
2016-11-16 15:33 1032在Javascript中,父元素包含子元素,当给父元素设置 ... -
一周APP UI交互设计动效灵感
2016-08-09 17:53 555一个好的动效设计可以提升UI界面与用户的交互体验,让枯燥的界 ... -
让界面动起来!移动动效设计必备灵感网站
2016-08-09 17:50 620扁平化的兴起,现在越来越流行动效设计,特别对于移动端,对交互 ... -
「添加购物」功能交互演示
2016-09-13 10:46 482几平每个购物网站都会有一个购物车功能,它可以算是不可缺少的 ... -
功能性动画UX设计:优秀的过渡转场效果(Transtion)
2016-08-09 17:43 485功能性动画(functional animation)是一种 ... -
表单动画 jQuery 插件:Form Animation Plugin
2016-08-09 17:35 492今天为大家分享的表单动画 jQuery 插件:Form An ... -
JS中的RegExp对象
2013-09-17 16:31 472JavaScript提供了一个RegExp对象来完成有 ... -
js获取项目根路径
2013-09-17 16:26 485//js获取项目根 ... -
javascript 中string转换int方法汇总
2012-07-12 16:38 871方法一: <script> var ... -
javascript中判断IP地址格式
2011-12-30 15:44 986function checkIp(ip){var ip ... -
input type=file的清空(javascript)
2011-12-29 10:26 1125<input name="f1" v ... -
Google 排名中的 10 个最著名的 JavaScript 库
2011-11-30 16:37 791JavaScript 是 Web 开发与设计中不可或缺的东西, ... -
js加载倒计时
2011-11-30 09:15 1115<script> var loadt ... -
js去掉前后空格
2011-11-28 11:54 737js实现TRIM功能<SCRIPT LA ...
相关推荐
当需要根据用户操作或特定条件动态地改变表单的提交目标时,可以使用JavaScript来修改`form action`属性。以下将详细讲解如何使用JavaScript来动态修改`form action`。 1. **基本语法** 在JavaScript中,可以使用`...
需要注意的是,表单的action属性是可以动态改变的,开发者可以通过JavaScript动态地修改表单的action属性,以改变数据提交的目标地址。 例如,如果我们想根据用户的某些操作更改表单提交的目标地址,可以编写如下...
2. **JavaScript动态修改Action属性**:通过JavaScript可以动态修改表单的`action`属性,从而改变表单提交的目标。这里的`FormSubmit`函数实现了这一功能。 ```javascript function FormSubmit() { document....
在这篇文章中,作者介绍了如何使用JavaScript动态地改变HTML表单(form)中的action属性值。action属性定义了表单提交到服务器后将请求发送到的URL。动态改变action属性可以使表单在不同条件下提交到不同的页面,...
纯JavaScript实现动态设置`action`属性,可以通过`document.getElementById`获取表单元素,然后直接访问或修改其`action`属性。以下是一些示例: ```javascript function test1() { // 获取表单元素 var form = ...
在jQuery这个强大的JavaScript库中,改变`form`表单的`action`属性值是常见的需求,尤其是在动态网页应用中。本文将详细介绍如何使用jQuery来实现这一功能。 首先,一个基本的HTML表单结构如下: ```html <form id...
通过`bind`方法或`form.loadRecord`方法可以加载和保存数据。 7. **表单验证**: 表单验证是确保用户输入符合预设规则的关键部分。ExtJS提供内置的验证功能,可以在字段级别或表单级别设置验证规则。 在这个案例...
通过JavaScript调用Struts Action的主要方式是利用AJAX技术或者直接通过改变页面URL来触发Action。这种方式可以避免页面的完全重载,从而提升用户体验。 - **利用AJAX技术**:可以通过XMLHttpRequest对象或jQuery等...
**jQuery.form.js** 是一个非常流行的JavaScript库,用于简化AJAX(异步JavaScript和XML)交互,特别是与HTML表单的交互。这个库是jQuery的一个扩展,它为处理表单数据提供了一种方便且强大的方式,包括无刷新的提交...
原生JavaScript作为Web开发的基础,提供了丰富的API和方法来处理表单元素,如input和select。本主题将深入探讨如何使用原生JavaScript对form表单进行美化,并对input输入框和select下拉框进行优化。 一、表单基础 1...
在HTML表单中,`<form>`标签的`action`属性用于指定表单数据提交的目标URL,而`method`属性则决定了数据是如何被发送到这个URL的,通常有`GET`和`POST`两种方式。当`method`设置为`GET`时,表单数据会被附加到`...
success: function(form, action){ if (action.result.success == "true") { var msg = action.result.msg; // 获取后端返回的消息 // 可以在这里处理成功的逻辑,例如显示消息、重定向页面等 } else { // ...
通过监听事件,如 `submit` 或 `click`,库会在事件处理函数中检查是否有设置 `formaction` 的元素,然后动态改变表单的提交行为,使其指向 `formaction` 指定的 URL。 3. **使用方法**:要在项目中使用 `polyfill-...
如果两个字段都填写了,它将动态修改`form`的`action`属性,将`/index/Search`作为目标URL,并附加一个查询参数`u`,其值为`usercode`。最后,调用`submit()`方法触发表单的提交。 这种方式的好处在于,你可以通过...
在网页设计中,表单(Form)是用户与网站交互的重要元素,用于收集用户输入的信息。"漂亮的form表单"这个主题关注的是如何创建既美观又功能强大的表单,以提高用户体验并提升网站的整体视觉效果。下面将详细介绍关于...
在JavaScript代码中,`document.getElementById("queryForm").action`可以设置或者修改这个提交地址。在示例代码中,`action`属性被设置为`"../news/starList.do?inputData="+hasInputed+"&artType="+type`,这表示...