file控件、hidden控件

file控件

定义文件选择字段和 "浏览..." 按钮,供文件上传。

  • 代码示例
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>file控件</title>
	</head>
	<body>
		请选择文件:<br>
		<form>
			<input type="file" />
		</form>
	</body>
</html>

![在这里插入图片描述]( https://img-blog.csdnimg.cn/2020081415370937.png?x-oss-process=image/watermark ,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80NTMzNDAyMg==,size_16,color_FFFFFF,t_70#pic_center)

hidden控件

定义隐藏输入字段(隐藏域)。

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>hidden控件</title>
	</head>
	<body>
		<form action="http://localhost:8080/html/test">
			<input type="hidden" name="userid" value="111" />
			用户代码:<input type="text" name="usercode" />
			<input type="submit" value="提交" />
		</form>
	</body>
</html>

![在这里插入图片描述]( https://img-blog.csdnimg.cn/2020081416273042.png?x-oss-process=image/watermark ,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80NTMzNDAyMg==,size_16,color_FFFFFF,t_70#pic_center)
在这里插入图片描述
网页上看不到,但是表单提交的时候数据会自动提交给服务器。

posted @ 2020-08-14 16:51  YU_UY  阅读(229)  评论(0)    收藏  举报