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">請選擇您是否支持 </td>
</tr>
<tr class=InputFrameLine>
<td width="28" align=right nowrap class='InputLableCell'>
<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> </td>
<td class='InputLableCell' nowrap> </td>
<td class='InputLableCell' nowrap> </td>
<td class='InputLableCell' nowrap> </td>
</tr>
<tr class=InputFrameLine>
<td class='InputFrameButtonLine' colspan=4 align='center'>
<input name="button" type='button' class=button onClick='vbscript:doSubmit()' value='確定' >
<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>