码迷,mamicode.com
首页 > 其他好文 > 详细

checkbox复选框获取多选项

时间:2018-02-14 10:33:14      阅读:173      评论:0      收藏:0      [点我收藏+]

标签:密码   val   post   input   word   utf-8   use   注册   box   

<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
</head>
<h1>用户注册</h1>
<form action="register2.php" method="post">
用户名:<input type="text" name="username"/><br/>
密码<input type="password" name="passwd"/><br/>
性别:<input type="radio" name="sex"  value="female" />女 <input type="radio" name="sex"  value="male" />男<br/>
你喜欢什么:
<input type="checkbox" name="hobby[]" value="唱歌">唱歌
<input type="checkbox" name="hobby[]" value="跳舞">跳舞
<input type="checkbox" name="hobby[]" value="游泳">游泳
<input type="checkbox" name="hobby[]" value="骑马">骑马
<br/>

需要在hobby后加[]就可以

checkbox复选框获取多选项

标签:密码   val   post   input   word   utf-8   use   注册   box   

原文地址:https://www.cnblogs.com/aten/p/8447898.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!