特点1
在form表单中.button标签不设置type=“button”,那么默认是type=“submit”
下面展示一些 内联代码片
。
点击后按钮后,就提交了
// An highlighted block
<form action="/abc?i=1" method="post">
<button>在form中button按纽不加入type="button",默认是submit</button>
</form>
特点2
form属性 action="/路径?k=v" ,如果想要带上action中的参数,必须使用post方式
下面展示一些 内联代码片
。
get不行带上参数
// An highlighted block
<form action="/abc?i=1" method="get">
<button>在form中button按纽不加入type="button",默认是submit</button>
</form>
post可以带上参数
// An highlighted block
<form action="/abc?i=1" method="post">
<button>在form中button按纽不加入type="button",默认是submit</button>
</form>
特点3
form表单中,有name属性,但无值 ,默认是空字符
下面展示一些 内联代码片
。
get和post方式进行测试
// An highlighted block
<form action="/abc?i=1" method="get">
<input type="text" name="username" />
<button>在form中button按纽不加入type="button",默认是submit</button>
</form>
// An highlighted block
<form action="/abc?i=1" method="post">
<input type="text" name="username" />
<button>在form中button按纽不加入type="button",默认是submit</button>
</form>