我想把所有本来是DropDownList取值改成弹出层取值,怎么实现?应该按个按钮来代替DropDownList

失去乐山贼 2010-10-27 08:20:02
我把表1的所有外键用DropDownList绑定,取到主键了,但是现在要改成弹出层来实现去值了。该怎么做呢?

...全文
91 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
dayou123123 2010-10-27
  • 打赏
  • 举报
回复
弹出层,单击赋值


<html>
<head>
<script language="javascript" type="text/javascript">
var _txt;

//设置tipbar的位置
function setTipLocation(e)
{

var intX=0,intY=0;

//判断有没有收到firefox的监听的event
if(e == null)
{
//当没收到时用window.event IE与Opera支持的
e = window.event;
}

if(e.pageX || e.pageY)
{
intX=e.pageX; intY=e.pageY;
}
else if(e.clientX || e.clientY)
{
if(document.documentElement.scrollTop)
{
intX=e.clientX+document.documentElement.scrollLeft;
intY=e.clientY+document.documentElement.scrollTop;
}
else
{
intX=e.clientX+document.body.scrollLeft;
intY=e.clientY+document.body.scrollTop;
// alert(intX);
// alert(intY);
}
}

//取得tooltip对象
var tipbar = $("divCho");

tipbar.style.top = (intY+7)+"px";
tipbar.style.left = (intX)+"px";
}

function $(re)
{
return document.getElementById(re);
}

//显示tooltip
function showTipbar(tag)
{
setTipLocation();
_txt=tag;
//取得tooltip对象
var tipbar = $("divCho");
tipbar.style.display = "";
tipbar.style.visibility='visible'

//tag.value="aa";
//alert( tipbar.innerHTML);

}

function show(aa)
{
showTipbar(aa);
}

function inhtml(aa)
{
_txt.value=aa.innerHTML;
var tipbar = $("divCho");
tipbar.style.display = "none";

}
</script>
</head>
<body>

<div id="divCho" title="弹出层" style="position: absolute; top: 0; left: 0; visibility: hidden;">
<a onclick="inhtml(this)" href="#">自提 </a>
<br />
<a onclick="inhtml(this)" href="#">送货 </a>
<br />
</div>

<input type="text" name="sendtype" onclick="show(this)" />

</body>
</html>
huangwenquan123 2010-10-27
  • 打赏
  • 举报
回复
有点不明白lz的描述
下面是一个弹出层,获取checkbox选中的值然后显示

<!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>
<title>无标题页</title>
<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#res").css("left",$("#zzz").css("left"));
$("#res").css("top",parseInt($("#zzz").css("top"))+22+"px");
$("#zzz").mouseover(function(){
$("#res").fadeIn();
})
$("#Button1").click(function(){
$("#zzz").empty();
$("#zzz").append("<option>"+$(result).html()+"</option>")
$("#res").fadeOut();
})
$("input[type=checkbox]").click(function(){
if($(this).attr("checked")==true)
$("#result").append($(this).val()+",");
else
$("#result").html($("#result").html().replace($(this).val()+",",""));
})
})
</script>

</head>
<body style="margin:0; padding:0; ">
<select id="zzz" style="left:300px;position:absolute;top:10px;height:22px;">
<option>请选择</option>
</select>
<div id="res" style="width:300px;height:300px;border:1px solid #ccc;z-index:10; background:yellow; FILTER:alpha(opacity=30);opacity=0.3;position:absolute; display:none;">
<input id="Button1" type="button" value="确定" /><span id="result"></span><br />
<input id="Checkbox1" type="checkbox" value="youku"/>youku
<input id="Checkbox2" type="checkbox" value="tudou" />tudou
<input id="Checkbox3" type="checkbox" value="baidu" />baidu
<input id="Checkbox4" type="checkbox" value="google" />google
</div>
</body>

</html>

失去乐山贼 2010-10-27
  • 打赏
  • 举报
回复
弹出模式窗口我试过了,就不能进入ASP控件事件了。
方案二:用一个层,在层里面绑定GridView取值,然后放入Sesstion ,接着在加载中判断Sesstion是否为空,不为空就显示在文本框中,但是第二次选择时,就不能改变文本框的值了。我感觉自己的这套思路不对。但是想不出别的。。。。
wuyq11 2010-10-27
  • 打赏
  • 举报
回复
window.open window.opener.document..
window.showModalDialog(..)
window.dialogargument
binli1017 2010-10-27
  • 打赏
  • 举报
回复
ms该同学是指 弹出窗口,需要用JAVASCRIPT. 百度搜下应该有。
失去乐山贼 2010-10-27
  • 打赏
  • 举报
回复
问题补充:我要在单击按钮后,在显示出来的层里选择一行,然后关闭,文本框就能显示出你选的值。
而不要刷新页面。
---------------------------------------------------------------------------------
diudiu121 2010-10-27
  • 打赏
  • 举报
回复
弹出层取值?
没大看明白

62,046

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧