jQuery中设置form表单中action值与js有什么不同。。。。
jQuery中设置form表单中action值与js有什么不同。。。。
HTML代码如下:
<form action="" method="post" id="form_id" name="form_name">
username:<input type="text" name="username" >
username:<input type="text" name="username" >
<input type="button" id="btn" value="测试">
</form>
在js里面有几种设置的方式:
1.document.form_name.action = "***.action/html/jsp/...";
2.document.form_name.attributes["action"].value = "***.action/html/jsp/...";
3.document.all("form_id").setAttribute("action", "欲赋的action的值");
4.document.getElementById("from_id").action = "***.action/html/jsp/...";
5.document.getElementsByName("from_id")[0].action = "***.action/html/jsp/...";//这是Elements,返回数组,此时取第一个form表单
在jquery里面设置form里面的action属性值:
1.$("#from_id").attr("action", "***.action/html/jsp/...");
注意!!!!
$("#from_id").action="***.action/html/jsp/..."; 这种写法是不起作用的!
jQuery中设置form表单中action值与js有什么不同。。。。的更多相关文章
- jQuery中设置form表单中action值的方法
jQuery中设置form表单中action值的方法 (2011-03-17 10:18:19) 转载▼ 标签: 杂谈 html代码: <form id="myFormId&quo ...
- jQuery中设置form表单中action的值的方法
下面介绍在jQuery中设置form表单中action的值的方法. $("#myFormId").attr("action", "userinfo.s ...
- jsp中的form表单中的 id和name有什么区别了
<form action="./system/WebServer_webServerLogin" method="post" id="login ...
- 第83天:jQuery中操作form表单
操作form表单 1. 属性操作 设置属性: // 第一个参数表示:要设置的属性名称 // 第二个参数表示:该属性名称对应的值 $(selector).attr(“title”, “传智播客”); 获 ...
- 在vue中的form表单中下拉框中的数据来自数据库查询到的数据
文章目录 1.实现的效果: 2.前端html代码 3.js中的代码 4.后端的方法 1.实现的效果: 增加一个新的类型到数据库 2.前端html代码 需要注意的部分:prop后边是表单中的字段 v-m ...
- 在 easyui中获取form表单中所有提交的数据 拼接到table列表中
form表单===== <!-- 并用药品填写信息弹框 --> <div id="usingProdctMsgDiv" style="display: ...
- 将 jsp 页面的值 传到struts2 action中(不是表单中的值)
JSP: 页面: <%@ page language="java" pageEncoding="GBK"%> <%@taglib prefi ...
- HTML form表单中action的正确写法
我的Java Web Application的context是myweb,即http://localhost:8080/myweb/index.jsp是欢迎页. 现在我的一个Controller的映射 ...
- jquery自动去除form表单中input框前后的空格
1. 2. <script type="text/javascript"> $(document).ready(function() { $('#searchform ...
随机推荐
- 复制远程共享文件夹内容到本地(python脚本实例)
本人自用脚本(python): #-*- coding:utf-8 -*- import sys , os , re def copyFileDir(srcFilename , desFilename ...
- 1 Maximum Product Subarray_Leetcode
Find the contiguous subarray within an array (containing at least one number) which has the largest ...
- strtok源码 bitset 空间压缩
源代码里有一段: unsigned char map[32]; /* Clear control map */ for (count = 0; count < 32; count++) map[ ...
- APPCAN开发笔记:html页面之间的参数传递:使用js获取url中的参数,以及在APPCAN中不能使用的解决方法
用PHP的GET/POST方式来传递方式已经是司空见惯了,但是如果我的页面是一个静态的html的页面,想传递参数的时候要怎么办呢?在APPCAN的开发中我们会经常遇到这样的问题,因为所有的页面都是静态 ...
- 【LFS】简易LFS搭建指南
http://blog.csdn.net/u012333520/article/details/50533002#comments ////////////////////////////////// ...
- pyqt的信号槽机制(转)
PySide/PyQt Tutorial: Creating Your Own Signals and Slots This article is part 5 of 8 in the series ...
- 修改Linux系统日期与时间date clock
先设置日期 date -s 20080103 再设置时间 date -s 18:24:30 为了永久生效,需要将修改的时间写入CMOS. 查看CMOS的时间: #clock -r 将当前系统时间写到C ...
- Delphi 中的自动释放策略-转
八.使用结构体而不是结构体指针: 很重要 一.指定 Owner 后, 随 Owner 连带释放: //uses Vcl.StdCtrls, Vcl.ExtCtrls; var panel: TPane ...
- ASP.NET中GridView数据导出到Excel
/// <summary> /// 导出按钮 /// </summary> /// <param name="sender"></para ...
- UGUI研究院之控件以及按钮的监听事件系统
继续学习,我相信大家在做NGUI开发的时候处理事件都会用到UIEventListener,那么UGUI中怎么办呢?先看UGUI的事件有那些吧 Supported Events The Eventsys ...