利用showModalDialog實現當前頁窗體彈出試偉值

test1.html文件

<script language="javascript">
function upOrDispose1()
{
alert("dd");
var s = new Object();
var upOrDispose;
var k = window.showModalDialog("test2.html",s,"dialogWidth:235px;status:no;dialogHeight:155px");
if(k.type!=""){
upOrDispose = k.upOrDispose;
document.input.upDispose.value=upOrDispose;
}
}
</script>
<html>
<form name="input">
<input type="text" name="upDispose" value=0>
<input type="button" οnclick="upOrDispose1();" value="test">
</form>
</html>

test2.html文件

<%@ Language=VBScript %>
<%
Response.Expires = 0
Response.Buffer = true
%>

<html>
<head>
<title>請選擇是否支持</title>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<SCRIPT LANGUAGE=javascript FOR=window EVENT=onload>
  <!--
   var s = new Object();
   s.type=""
   window.returnValue = s;
  //-->
</SCRIPT>
</HEAD>
<BODY >
<table align="center" width="194" class="InputFrameMain">
<form name="form1" method=post>
<tr>
      <td><table border=0 align=center cellpadding=0 cellspacing=0 style="Margin:5px 5px 5px 5px">
      
           <tr class=InputFrameLine>
            <td class='InputAreaCell' nowrap colspan="4">請選擇您是否支持&nbsp;</td>
          </tr>
   
       <tr class=InputFrameLine>
            <td width="28" align=right nowrap class='InputLableCell'>&nbsp;
              <input type="radio" name="upOk" checked value="1">
            </td>
            <td width="50"  nowrap class='InputAreaCell'>支持 </td>
            <td width="37"  nowrap class='InputAreaCell'><input type="radio" name="upOk"  value="2">
            </td>
            <td width="36"  nowrap class='InputAreaCell'>反對 </td>
          </tr>
          <tr class=InputFrameLine>
            <td class='InputLableCell' nowrap align=right>&nbsp;</td>
            <td class='InputLableCell'   nowrap>&nbsp; </td>
            <td class='InputLableCell'   nowrap>&nbsp; </td>
            <td class='InputLableCell'   nowrap>&nbsp; </td>
          </tr>
          <tr class=InputFrameLine>
            <td class='InputFrameButtonLine' colspan=4 align='center'>
    <input name="button" type='button' class=button onClick='vbscript:doSubmit()' value='確定' >
              &nbsp;    &nbsp;    &nbsp;    &nbsp;
     <input name="button" type='button' class=button onClick='vbscript:window.close' value='取消' >
            </td>
          </tr>
        </table></td>
    </tr>
</form>
</table>
<script language=javascript>
<!--
 //var k=window.dialogArguments;
 //var supOk
 //supOk = k.upOk;
 function doSearch()
 {
  var s = new Object();
  s.type="ok"
  //s.upOk=form1.upOk.value;
  if(form1.upOk(1).checked)
   s.upOrDispose="2";
  else
   s.upOrDispose="1";
  window.returnValue=s;
  window.close();
 } 
//-->
</script>
<script language=vbscript>
<!--
 function doSubmit()
  call doSearch()
 end function
//-->
</script>
</BODY>
</HTML>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值