正在加载图片...
主要属性 (1) action:指定当点击表单内的“确认”或“提交”按钮时, 该表单将提交给 action指定的程序来接受和响应。该属性值可以是 个相对路径或者URL (2) method:指定提交该表单时,采用的数据传输方式,即提 交表单时发送何种类型的请求。该属性值为“GET”或“POST” (3)name:指定表单的唯一名称 (4) target:指定使用哪种方式来打开 action指定的响应程序 页面。 (5) enctype:指定表单内的文字编码方式。该属性值为 “ application/x-www-form- urlencode”、“ multipart/form-data”、 “text/ plain 案例: 示例7-1:表单提交方式 使用GET方式提交表单 <meta charset="utf-8 ttfe>表单属性GET<,ite </head> <form method="get"name="UserLogin"action="7-1-Sphp"> p>账号: <input type="text"name=" UserNar maxlength="20"width="30"> <p>p A: <input type="password"name="UserPWD" maxlength="20"width=30"> p>< input type=" submit"name=" Submit" value="提交表单"> </html> 利用POST方式提交表单 <doctype html> <meta charset="utf-8 <tte>表单属性-POsT</ Ititle 2《网页设计与网站规划》讲稿/河南中医学院互联网应用技术研究所/htp/ bs. 51xueweb cn2 《网页设计与网站规划》讲稿 / 河南中医学院互联网应用技术研究所 / http://labs.51xueweb.cn 主要属性: (1)action:指定当点击表单内的“确认”或“提交”按钮时, 该表单将提交给 action 指定的程序来接受和响应。该属性值可以是 一个相对路径或者 URL。 (2)method:指定提交该表单时,采用的数据传输方式,即提 交表单时发送何种类型的请求。该属性值为“GET”或“POST”。 (3)name:指定表单的唯一名称。 (4)target:指定使用哪种方式来打开 action 指定的响应程序 页面。 (5)enctype:指定表单内的文字编码方式。该属性值为 “application/x-www-form-urlencoded”、“multipart/form-data”、 “text/plain”。 案例: 示例 7-1:表单提交方式 使用 GET 方式提交表单: <!doctype html> <html> <head> <meta charset="utf-8"> <title>表单属性-GET</title> </head> <body> <form method="get" name="UserLogin" action="7-1-S.php"> <p>账号:<input type="text" name="UserName" maxlength="20" width="30"> <p>口令:<input type="password" name="UserPWD" maxlength="20" width="30"> <p><input type="submit" name="Submit" value="提交表单"> </form> </body> </html> 利用 POST 方式提交表单: <!doctype html> <html> <head> <meta charset="utf-8"> <title>表单属性-POST</title>
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有