本文摘自PHP中文网,作者php中世界最好的语言,侵删。
这次给大家带来怎样实现html的可输入下拉菜单,实现html的可输入下拉菜单的注意事项有哪些,下面就是实战案例,一起来看一下。1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | < 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 >
|
要获得可输入下拉菜单的值,只要获得输入框的值即可。
注意:
1 | </span><input name= "box" style= "width:160px;position:absolute;left:0px;" >
|
这行要在一行中,不能写成
1 2 | </span>
<input name= "box" style= "width:160px;position:absolute;left:0px;" >
|
换行了之后则下拉菜单的值不能显示在 输入框中。
阅读剩余部分
相关阅读 >>
html中的form标签有什么作用?html form标签的用法解释
在html中怎样可以用超链接打开新窗口并且控制窗口属性
html入门必知
详解html实现在线预览word、excel、pdf等文件的功能(附代码)
html img标签的使用
html里面ul那个点怎么消
使用html实现简单的柱状图效果
html首行缩进怎么设置
html font标签如何设置字体粗细,font标签的字体样式总结
html怎么进行页面跳转(重定向)
更多相关阅读请进入《下拉菜单》频道 >>
人民邮电出版社
本书对 Vue.js 3 技术细节的分析非常可靠,对于需要深入理解 Vue.js 3 的用户会有很大的帮助。——尤雨溪,Vue.js作者
转载请注明出处:木庄网络博客 » 怎样实现html的可输入下拉菜单