可输入下拉菜单,不可思议是不是, 本例通过一些方法实现这个不可能的事情,感兴趣的朋友可以参考下
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<body>
<?php
echo '
<form name="ddform" method="get" action="">
<p style="position:relative;">
<span style="margin-left:100px;width:18px;overflow:hidden;">
<select style="width:180px;margin-left:-100px" onchange="this.parentnode.nextsibling.value=this.value" name="hh">
<option value="汽车">汽车 </option>
<option value="火车"> 火车 </option>
<option value="飞机"> 飞机 </option>
</select>
</span><input name="box" style="width:160px;position:absolute;left:0px;">
<input value="提交" name="submit" type="submit"/>
</p>
</form>';
$aa=$_get['hh']."111"; // select 下拉菜单的值
$bb=$_get['box']."222"; // 输入框的值
echo $aa;
echo "</br>";
echo $bb;
// 要获得可输入下拉菜单的值,只要获得输入框的值即可。
?>
</body>
</html>
要获得可输入下拉菜单的值,只要获得输入框的值即可。
注意: 54bdf357c58b8a65c66d7c19c8e4d114755e7fcd76b174c0ebd63be04715e7eb
这行要在一行中,不能写成
54bdf357c58b8a65c66d7c19c8e4d114
755e7fcd76b174c0ebd63be04715e7eb
换行了之后则下拉菜单的值不能显示在 输入框中。
还可以根据输入的内容自动选择匹配的菜单值。
更多html 可输入下拉菜单的实现。
