1、打开Dreamweaver 编辑器,准备好一个空白的html文件,写入基本的html结构:
2、创建表单,演示中表单中设置年龄和姓名两个属性,然后创建提交按钮:
3、上方设置script标签,在里面创建js函数,函数内容为获取表单提交
3、接着打开浏览器预览效果,在表单内填入内容点击提交:
4、点击提交后,js就会把数据提交到指定位置了。以上就是HTML提交表单的操作:
<form action="check.php" method="post">
用户名:<input type="text" name="user">
密码:<input type="password" name="pw">
<input type="submit" value="提交">
</form>
上面就是一个简单的form表单的简单代码,
method 属性规定如何发送表单数据(表单数据发送到 action 属性所规定的页面)。
表单数据可以作为 URL 变量(method="get")或者 HTTP post (method="post")的方式来发送。
扩展资料:
其他方法html中的表单提交:
<html>
<head>
<script type="text/javascript">
function formSubmit( )
{
document.getElementById("myForm").submit( )
}
</script>
</head>
<body>
<form id="myForm" action="js_form_action.asp" method="get">
Firstname: <input type="text" name="firstname" size="20"><br />
Lastname: <input type="text" name="lastname" size="20"><br />
<br />
<input type="button" onclick="formSubmit()" value="Submit">
</form>
</body>
</html>
本回答被网友采纳