首页 > 其他 > 详细

checkbox复选框获取多选项

时间:2018-02-14 10:26:25      阅读:301      评论:0      收藏:0      [点我收藏+]
<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复选框获取多选项

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!