2009年9月21日 星期一

window.showModalDialog範例~

window.showModalDialog

 
Mfg_Steel.aspx
< input id="Button2" onclick="test1();" value="加入工時" type="button" >
--------------------------------------------------------
<script language="javascript">
function test1( ){
var obj=document.getElementById("GridView2$ctl02$txtJSM1");
window.showModalDialog("Mfg_Steel_2.htm",obj,"dialogWidth=800px;dialogHeight=800px");
}
</script>
☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆
Mfg_Steel_2.htm
56<input id="Radio3" onclick="radiovalue2(value);" value="56" type="radio" name="SFB">
112<input id="Radio10" onclick="radiovalue3(value);" value="112" type="radio" name="SFD">
--------------------------------------------------------
<input id="Button1" onclick="sum1();" value="加總" type="button">
<input id="Button2" onclick="testb();" value="送出" type="button">
--------------------------------------------------------
<script language="javascript">
objtxt1 = document.getElementById("Text1") ;
objtxt2 = document.getElementById("Text2") ;
objtxt3 = document.getElementById("Text3") ;
function radiovalue2(value2){
sfb = value2;
objtxt2.value = sfb;
}
function radiovalue3(value3){
sfd = value3;
objtxt3.value = sfd;
}
function sum1( ){
objtxt1.value = parseInt(objtxt2.value) + parseInt(objtxt3.value)
}
function testb( ){
var objb= window.dialogArguments;
objb.value=objtxt1.value;
window.close( );
}
</script>

沒有留言:

張貼留言