From表单提交的几种方式

Stella981
• 阅读 517
<body>
        <form action="https://my.oschina.net/u/3285916" method="get" name="formOne" id="formId">
            name:<input type="text" name="name">
            pwd:<input type="password" name="pwd"><br/>
            <input type="button" value="1提交" onclick="document.forms[0].submit()">
            <input type="button" value="2提交" onclick="this.form.submit()">
            <input type="button" value="3提交" onclick="document.formOne.submit()">
            <input type="button" value="4提交" onclick="document.getElementById('formId').submit()">
            <input type="submit" value="5提交">
            <input type="submit" value="6提交" onclick="doSubmit()">
        </form>
        <script type="text/javascript">
            function doSubmit(){
                //表单提交
                document.forms.submit();
            }
        </script>
  </body>
点赞
收藏
评论区
推荐文章
Wesley13 Wesley13
2年前
java将前端的json数组字符串转换为列表
记录下在前端通过ajax提交了一个json数组的字符串,在后端如何转换为列表。前端数据转化与请求varcontracts{id:'1',name:'yanggb合同1'},{id:'2',name:'yanggb合同2'},{id:'3',name:'yang
Stella981 Stella981
2年前
PHP导入导出EXCELl,CSV
PHP导入导出Excel,CSVHTML<formaction"{:U('Admin/Unit/importcsv')}"method"post"name"myform"id"myform"enctype"multipart/formdata"<input
Wesley13 Wesley13
2年前
PHP 表单
1、一个简单的HTML表单POSt方法包含两个输入字段和一个提交按钮<html<body<formaction"welcome.php"method"post"Name:<inputtype"text"name"name"<brEmail:<inputty
Wesley13 Wesley13
2年前
PHP创建多级树型结构
<!lang:php<?php$areaarray(array('id'1,'pid'0,'name''中国'),array('id'5,'pid'0,'name''美国'),array('id'2,'pid'1,'name''吉林'),array('id'4,'pid'2,'n
Wesley13 Wesley13
2年前
JS获取表单元素的值
<html<head<metahttpequiv"contenttype"content"text/html;charsetutf8"<title测试</title</head<body<formid"form1"name"form1"文本框
Wesley13 Wesley13
2年前
oracle游标的例子
declare    cursor ca is select id_no, name from user where ym201401;begin    for cb in ca loop        update path set enamecb.name where id_nocb.id
Stella981 Stella981
2年前
Jfinal文件上传
1\.给form添加enctype"multipart/formdata"属性,如下:<formid"form"action"/fileController/upload"method"post"enctype"multipart/formdata"<inputtype"file"name"f
Stella981 Stella981
2年前
HTML5新增input标签属性
一.inputtype属性1<formaction""2邮箱<inputtype"email"name""id""<inputtype"submit"value"提交"<br/<br/3手机号码<inputtype"tel"name
Wesley13 Wesley13
2年前
ES6 新增的数组的方法
给定一个数组letlist\//wu:武力zhi:智力{id:1,name:'张飞',wu:97,zhi:10},{id:2,name:'诸葛亮',wu:55,zhi:99},{id:3,name:'赵云',wu:97,zhi:66},{id:4,na