小妹妹求教一个 窗口小问题 在线等

iamlain 2003-09-15 09:38:14
如果在点击一个BUTTON后弹出一个新的对话框

大小怎么设定 ?

在新对话框选择后又如何通过BUTTON自动关闭
把获取的变量传递给第一个对话框

高手解答解答 有事例代码最好

还有个小问题
怎样让TEXTBOX 只能输入数字 输入字符无效呢
...全文
35 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
iamlain 2003-09-15
  • 打赏
  • 举报
回复
回答能不能有点深度
我用的是 VB NET

请注意语言哦

不要乱UP贴子
stephenzhou1234 2003-09-15
  • 打赏
  • 举报
回复
<html>
<head>
<title>选择籍贯所在地</title>


</head>


<script language="JavaScript">
function setinfo(jgm,jg)
{
alert(jgm);
alert(jg);
return true;
}
</script>

<frameset rows="*" cols="33%,33%,34%">
<frame src="listjg.asp" name="content" frameborder="0" target="selected1">
<frame src="selectedjg1.asp" name="selected1" frameborder="0" target="selected2">
<frame src="selectedjg2.asp" name="selected2" frameborder="0">
</frameset>
<noframes><body bgcolor="#FFFFFF" text="#000000">
</body></noframes>
</html>
stephenzhou1234 2003-09-15
  • 打赏
  • 举报
回复
我有个例子 你参考参考

var gcToggle = "#ffff00";
var gcBG = "#CCCCFF";

function Jetech_GetSelected(aCell)
{

window.returnValue = aCell.innerText;
window.close();

}
function getSelected(Names,values)
{
window.returnValue = Names+"!"+values;
window.close();
}

//选机构、人、项目等
function chooseWindow(url2,Width2,Height2){
var showx2 = Width2;
var showy2 = Height2;
var features2 =
'width=' + Width2 +
', height=' + Height2 +
', left=' + showx2 +
', top=' + showy2 +
', directories=no, localtion=no, menubar=no, status=no, toolbar=no, scrollbars=no, resizeable=no';
popWindow2=window.open(url2,"",features2);
}


function receiveRef(dialogType,idObject,nameObject,Width,Height){
var endtarget;
if(dialogType == "SelectUnit"){
endtarget = "unit/selectunit.jsp";

}else if(dialogType=="SelectUser"){
endtarget = "../person/select_person.jsp?idObject="+idObject+"&nameObject="+nameObject;
}else if(dialogType=="SelectProject"){
endtarget = "../project/select_project.jsp?idObject="+idObject+"&nameObject="+nameObject;
}else if(dialogType=="SelectWork"){
endtarget = "../project/projectWorkEdit.jsp?action="+idObject+"&workid="+nameObject;
}else if(dialogType=="getpersoninfo"){
endtarget = "../project/getpersoninfo.jsp?idObject="+idObject+"&nameObject="+nameObject;
}else if(dialogType=="SelectUserInfo") {
endtarget="../person/select_personinfo.jsp?idObject="+idObject+"&nameObject="+nameObject;
}

showx = event.screenX - event.offsetX - Width ; // + deltaX;
showy = event.screenY - event.offsetY - Height - 30; // + deltaY;


var features =
'width=' + Width +
', height=' + Height +
', left=' + showx +
', top=' + showy +
', directories=no, localtion=no, menubar=no, status=no, toolbar=no, scrollbars=no, resizeable=no';
popWindow=window.open(endtarget,"",features);
}



function fPopUpDlg(dialogType,ctl1,ctl2,WINwidth,WINheight){
// alert("lskdfj;ladkfj;fj");
var endtarget;
if(dialogType == "SelectUnit"){
endtarget = "../unit/selectunit.jsp";
alert(endtarget);
}else if(dialogType=="SelectUser"){
endtarget = "../select_person.jsp";
}


showx = event.screenX - event.offsetX - 4 - WINwidth ; // + deltaX;
showy = event.screenY - event.offsetY + 18; // + deltaY;

if (dialogType == "POPUPLIST_CONTRACTSTOP"){
showx = event.screenX - event.offsetX - WINwidth + 150;
showy = event.screenY - event.offsetY + 20;


}

newWINwidth = WINwidth + 4 + 18;
var features =
'dialogWidth:' + newWINwidth + 'px;' +
'dialogHeight:' + WINheight + 'px;' +
'dialogLeft:' + showx + 'px;' +
'dialogTop:' + showy + 'px;' +
'directories:no; localtion:no; menubar:no; status=no; toolbar=no;scrollbars:no;Resizeable=no';


var accounts=ctl1.value+"!"+ctl2.value;

retval = window.showModalDialog(endtarget,accounts,features);
if( retval != null ){
var token=retval.indexOf('!',0);
ctl1.value =retval.substring(0,token);
ctl2.value =retval.substring(token+1);
}else{
//alert("canceled");
}
}


function fPopUpCalendarDlg(ctrlobj)
{
showx = event.screenX - event.offsetX - 4 - 210 ; // + deltaX;
showy = event.screenY - event.offsetY + 18; // + deltaY;
newWINwidth = 210 + 4 + 18;

retval = window.showModalDialog("../../inc/CalendarDlg.asp", "", "dialogWidth:197px; dialogHeight:210px; dialogLeft:"+showx+"px; dialogTop:"+showy+"px; status:no; directories:yes;scrollbars:no;Resizable=no; " );
if( retval != null ){
ctrlobj.value = retval;
}else{
//alert("canceled");
}
}

function select_xs(obj)
{
var openurl="../../inc/xs_select/xs_select.asp";
retval=new Array("","");
retval=window.showModalDialog(openurl,'Select_XS',"dialogWidth:600px; dialogHeight:400px; dialogLeft:40px; dialogTop:40px; status:no; directories:yes;scrollbars:no;Resizable=no; " );
if ((obj != null) && (retval != null))
{
obj.value=retval[1];
}
if ((obj==null) && (retval !=null))
{
document.all.xs.value=retval[0];
document.all.dw_list.value=retval[1];
}
}

function select_xz()
{
var openurl="../../inc/xz_select/xz_select.asp";
window.open(openurl,'Select_XZ','scrollbars=yes,top=40,left=40,height=360,width=420');
}

function select_xzqh(obj)
{
var openurl="../../inc/xzqh_select/xzqh_select.asp";
retval=new Array("","");
retval=window.showModalDialog(openurl,'Select_XZQH',"dialogWidth:600px; dialogHeight:540px; dialogLeft:40px; dialogTop:40px; status:no; directories:yes;scrollbars:no;Resizable=no; " );
//retval=window.open(openurl);
if ((obj != null) && (retval != null))
{
obj.value=retval[1];
}

}


stephenzhou1234 2003-09-15
  • 打赏
  • 举报
回复
哈哈
liq1979 2003-09-15
  • 打赏
  • 举报
回复
1、使用window.showModalDialog()
2、使用正直表达式。^\d+$
wacle 2003-09-15
  • 打赏
  • 举报
回复
string strJava="<script language='javascript'>document.frm1.txt1.value=window.showModalDialog('a.htm?xx=2','window','dialogHeight:700px;dialogWidth:720px;tools:no;status:no')</script>";
Page.RegisterClientScriptBlock("newwin",strJava);

a.aspx is embed in a.htm

关闭窗口时:
in page_load:
btnClose.Attributes["onclick"]="javascript:CloseWindow()";

then in html:
function CloseWindow()
{
top.returnValue=document.getElementById("txtvalue").value;
window.close();
}

62,042

社区成员

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

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

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

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