第一句<form id="form1" name="form1" method="post" action="">在这段代码中的意思是什么?

<form id="form1" name="form1" method="post" action="">
<p>单行文本域:<input type="text" name="textfield" id="textfield"/></p>
<p>密码域:<input type="password" name="passwordfield" id="passwordfield"/></p>
<p>多行文本域:<textarea name="textareafield" id="textareafield"></textarea></p>
<p>复选框:
复选框1<input name="checkbox1" type="checkbox" value=""/>
复选框2<input name="checkbox2" type="checkbox" value=""/>
</p>
<p>下拉菜单:
<select name="selectlist">
<option value="1">选项 1</option>
<option value="2">选项 2</option>
<option value="3">选项 3</option>
</select>
</p>
<p><input type="submit" name="button" id="button" value="提交"/></p>
</form>

form是表单,只有当你把数据包含在form表单中你的button是submit类型的时候,你点击提交了,
method="post" action=""
method你使用post方式,就是你发送的数据就不会在网址体现出来而直接发送到服务端上,然后你的action是提交动作,也就是你提交过去的页面,比如我写action=test.asp,,那么我在test页面使用request就可以获取你提交过来的所有数据

textfield = request("textfield")
passwordfield = request("passwordfield")
......
selectlist = request("selectlist")
我们就能对获取的数据进行其他加工处理,比如我要写入表啊,我要做其他判断等等
温馨提示:答案为网友推荐,仅供参考
第1个回答  推荐于2017-09-11
所有的这些控件都在 这个id为“form1” name为“form1”的表单(form)中
这个表单提交数据的方式 method 是 “post” (提交数据一般有“get”和“post”)
action 提交的地址 为“” 就是将这些数据提交给谁来处理
给你推荐个网站吧 http://www.w3school.com.cn/ 一些网页基础知识本回答被提问者采纳