HTML基礎教學表單中的HTML標籤
表單能夠包含 input 元素,例如文字欄位、複選框、單選方塊、提交按鈕等等。
表單也可以包含 menus、textarea、fieldset、legend 和 label 元素。
name:給表單起個名字。這個名字主要給JavaScript來用。 JS主要用來做客戶端表單驗證。
method:表單的提交方式,取值:get或post。
action:指定表單的處理程序,一般是PHP檔。
如果action為空,那麼表單資料發到哪裡去了?
結果:表單將資料提交給了它自己來處理。
enctype:指定表單資料的編碼方式(解密方式)。這個屬性只能用在 method = “post” 的情況。
application/x-www-form-urldecoded //預設的加密方式
multipart/form-data //如果你上傳文件,該值必須它自己。
新建檔案
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>用户注册</title>
</head>
<body>
<font size="5" color="red">欢迎注册php.cn</font>
<form name="user" method="get" action="" >
用户名:<input type="text" name="username"/>
<br/>
密码:<input type="password" name="userpwd"/>
<br/>
<input type="submit" value="提交信息"/>
</form>
</body>
</html>
預覽
Clear
- 課程推薦
- 課件下載
課件暫不提供下載,工作人員正在整理中,後期請多關注該課程~ 















