如何传递SELECT 下拉列表的值?
根据网上那个教程没法获取值
<form id="form1" name="form1" method="post" action="abcd.php">
<align="right">
<select name="select" size="1">
<option values="name">客户姓名</option>
<option values="tel">客户电话</option>
<option values="card">卡号</option>
</select>
<input name="querysle2" type="text">
<input type="submit" value="查询"><br>
</form>
abcd.php
session_start();
$theselect=$_POST['select'];
$thevalue=$_POST['querysle2'];
if(empty($thevalue))
{
echo "<script>alert('错误:查询条件不能为空');location.href='queryrecord.php';</script>";
}
echo $theselect;
echo $thevalue;
结果是 客户姓名12323213
[解决办法]
<select name="select" size="1">
<option>请选择</option>
<option values="name">客户姓名</option>
<option values="tel">客户电话</option>
<option values="card">卡号</option>
</select>
这样就可以了
[解决办法]
<select name="select" size="1">
<option value="name">客户姓名</option>
<option value="tel">客户电话</option>
<option value="card">卡号</option>
</select>
是value,而不是values