<!DOCTYPE html>
<html>
<head>
<title>JavaScript表单提交四种方式</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type="text/javascript" >
function submit()//第二种提交方式,用普通button按钮结合JavaScript提交
{
alert(11);

//设置提交路径
var submit= document.getElementById("submit");
submit.submit(); //提交
}
</script>
</head>
<body>
<!-- 第一种提交方式也是最普遍的提交方式 -->
<form action="1111.html">
用户名:<input type="text" value="1234" name="username">
<input type="submit" value="submit提交"/>
</form>
<hr>
<!-- 第二种提交方式,用普通button按钮结合JavaScript提交-->
<form id="form1" action="2222.html">
用户名:<input type="text" value="1234" name="username">
<input id="submit" type="button" value="普通button结合JavaScript提交" onclick="submit();"/>
</form>
<hr>
<!-- 第三种提交方式,用图片提交-->
<form action="3333.html">
用户名:<input type="text" value="1234" name="username">
<input type="image" src="fmy.jpg" width="50px" height="50px"/>
</form>
<hr>
<!-- 第四种提交方式,超链接提交,直接把表单内容写在链接中,几乎没人用-->
<a href="44444.html?username=1234">超链接提交,直接把表单内容写在链接中,几乎没人用</a>
</body>
</html>

form表单4种提交方式的更多相关文章

  1. form表单两种提交方式的不同

      我们在使用<Form>表单的时候,最常用的提交方式就是Get和Post.我们都知道这两种方式最大的差别就是安全性,除此之外,它们还有哪些其他的区别,你知道吗?   在<Form& ...

  2. 6.form表单四种提交方式

    一.使用jquery的ajax方式提交: 二.使用easyui的form组件内置的submit方法提交: 三.先定义表单,然后使用submit方法提交: 四.先定义表单,然后按下enter键时提交:

  3. HTML form表单的默认提交方式

    默认为Get,亲测.. key值为控件name属性值,如果没有 url中就没有此值 aspx中默认Form表单提交方式为post

  4. Form表单三种提交按钮的区别?

    1.<input type='button' id='btn' onclick='check()' value="提交"> 说明:只是普通的按钮(不附带提交功能),不会 ...

  5. 防止表单提交时刷新页面-阻止form表单的默认提交行为

    最近在写 ajax 提交的时候遇到一个问题,在执行 ajax 提交之后,浏览器页面自动刷新了,主要是没有 由于form 表单的默认提交行为.一下是几种阻止 form 表单默认提交行为的方式. 1.使用 ...

  6. 微信小程序:input输入框和form表单几种传值和取值方式

    1.传值:index下标传值.页面navigator传值 1.index下标 实现方式是:data-index="{{index}}"挖坑及e.currentTarget.data ...

  7. 通过button将form表单的数据提交到action层

    form表单中不需要写action的路径,需要给form表单一个唯一的id,将你要提交的信息的表单中的标签name="action中的javabean对象.javabean属性". ...

  8. form 表单跨域提交

    <!DOCTYPE html><html> <head> <title>form 表单上传文件</title> <script src ...

  9. jquery序列化form表单使用ajax提交后处理返回的json数据

    1.返回json字符串: /** 将一个字符串输出到浏览器 */ protected void writeJson(String json) { PrintWriter pw = null; try ...

随机推荐

  1. android Bitmap用法总结(转载)

    Bitmap用法总结1.Drawable → Bitmappublic static Bitmap drawableToBitmap(Drawable drawable) {Bitmap bitmap ...

  2. js 滚动页面

    $(‘html, body’).animate({ scrollTop: 0}, ‘slow’);

  3. php在linux中执行外部命令

    目录:一.PHP中调用外部命令介绍二.关于安全问题三.关于超时问题四.关于PHP运行linux环境中命令出现的问题 一.PHP中调用外部命令介绍在PHP中调用外部命令,可以用,1>调用专门函数. ...

  4. structure machine learning projects 课程笔记

    orthogonalization/ one metric train.dev/test 划分 开发集和测试集一定来自同一分布  onthe  same distribution Human leve ...

  5. win10 更新导致 VisualSVN 报0x80041024错错误

    主要是WMI丢失,重新注册下就好. 运行cmd.exe, 运行语句:mofcomp "%VISUALSVN_SERVER%WMI\VisualSVNServer.mof" 修复即可 ...

  6. 一次Tomcat6.0.33版本号与6.0.44版本号差异所引发的问题

    前序(公司应用为Web应用, 部署serverLinux + Nginx + Tomcat ) 一天收到公司报警邮件,显示个别机器方法调用严重超时,寻常都是在100ms以内响应的方法,突然某段时间响应 ...

  7. poj 2752 Seek the Name, Seek the Fame (KMP纯模版)

    Seek the Name, Seek the Fame Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 13840   Ac ...

  8. Eclipse中JSP页面默认编码修改

    jsp页面默认编码为ISO-8859-1 要修改为UTF-8,步骤如下 选择windon-->preference 在弹出框操作 以后新建jsp页面编码为UTF-8编码

  9. [Algorithms] KMP

    KMP is a classic and yet notoriously hard-to-understand algorithm. However, I think the following tw ...

  10. 表单验证 靠name获取

    表单 靠name获取 <form class="add-form" name="form" action="#" method=&qu ...