就是想在一个可以输入的输入框后加个选择,选择之后呢会有个菜单列表(列出可以选择的项)且是可以多选的。选择确定之后选择的多值都能传到输入框内。what??
解决方案 »
- 奇怪的多级联动菜单
- 我想根据Label的Visible属性去更改一个链接是否生效,用jquery怎么实现阿.在线等待...
- js无刷新分页
- 求助,JavaScript的加密算法
- 如何获得字符串中的值,先判断是否含有(max.),再取其中的值
- javascript实现仿Google智能提示
- ASP/JAVASCRIPT代码格式化工具
- 请高手帮忙解决使用LyfUpload 上传组件碰到的问题。错误 '800a0047'
- 关于Execl如何放到服务端运行.
- IE4.0里的window.close()--在线等待..
- firefox里新闻图片轮换功能失效怎么办
- 层拖拽效果的一点问题,高分求,大家看看啊!!
选择的值就可以传到输入框。例如:在输入框中可以自定义输入设计师的名字,也可以点击选择有部分设计师的候选菜单
而且是可以多选的,加入菜单列表中有,s1、s2、s3、s4、s5、s6.我选择s1、s2后 s1、s2就会显示在输入框内
还不能明白吗 ??可以看http://www.tobosu.com/ningbo/fabu.html就是在意向设计师的输入框后面再加个选择按钮,点选择有个选择菜单
,列出部分推荐的设计师供选择,而且是可以多选的,选的设计师要显示在前面的输入框内。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script type="text/javascript">
function selValue(){
document.getElementById("divValue").style.display = "block";
}
function closeDiv(isSave){
if(isSave){
var result = [];
var chk = document.getElementsByName("chk");
for(var i=0; i<chk.length; i++){
if(chk[i].checked)
result.push(chk[i].value);
}
document.getElementById("txt").value = result.join(",");
}
document.getElementById("divValue").style.display = "none";
}
</script>
</head><body>
<div>
测试: <input type="text" id="txt" name="txt" /> <a href="javascript:selValue();">选值</a>
<div id="divValue" style="display:none;position:absolute; width:200px; height:130px; border:1px solid #006699; background:#F5F6FB; padding:5px; line-height:22px;">
<input type="checkbox" id="chk1" name="chk" value="1" />1<br />
<input type="checkbox" id="chk2" name="chk" value="2" />2<br />
<input type="checkbox" id="chk3" name="chk" value="3" />3<br />
<input type="checkbox" id="chk4" name="chk" value="4" />4<br />
<input type="checkbox" id="chk5" name="chk" value="5" />5<br />
<a href="javascript:closeDiv(true);">确定</a>
<a href="javascript:closeDiv(false)">取消</a>
</div>
</div>
</body>
</html>
等下给分哈
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script type="text/javascript">
function selValue(){
document.getElementById("divValue").style.display = "block";
}
function closeDiv(isSave){
if(isSave){
var result = [];
var chk = document.getElementsByName("chk");
for(var i=0; i<chk.length; i++){
if(chk[i].checked)
result.push(chk[i].value);
}
if(result.length > 3){
alert("最多只能选3项!");
return;
}
document.getElementById("txt").value = result.join(",");
}
document.getElementById("divValue").style.display = "none";
}
</script>
</head><body>
<div>
测试: <input type="text" id="txt" name="txt" /> <a href="javascript:selValue();">选值</a>
<div id="divValue" style="display:none;position:absolute; width:200px; height:130px; border:1px solid #006699; background:#F5F6FB; padding:5px; line-height:22px;">
<input type="checkbox" id="chk1" name="chk" value="1" />1<br />
<input type="checkbox" id="chk2" name="chk" value="2" />2<br />
<input type="checkbox" id="chk3" name="chk" value="3" />3<br />
<input type="checkbox" id="chk4" name="chk" value="4" />4<br />
<input type="checkbox" id="chk5" name="chk" value="5" />5<br />
<a href="javascript:closeDiv(true);">确定</a>
<a href="javascript:closeDiv(false)">取消</a>
</div>
</div>
</body>
</html>