点击按钮弹出页面获取值

<!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">
function winOpen (strURL,strName,width,height){
theWindow = window.open (strURL,strName,"width="+width+" height="+height+" scrollbars=yes left="+(1024-width)/2+" top="+(768-height)/2);
if (theWindow.opener == null) theWindow.opener = window;
if (window.focus) theWindow.focus();
}
function save(){
alert(document.getElementById("tid").value);
alert(document.getElementById("tname").value);
}
</script>
</head>
<body>
<from action="xx.action" method="post">
<!--部门ID-->
<input type="hidden" name="typeid" id="tid" value="">

请选择部门名称:<input type="text" name="v_type_name" id="tname" size="30" value=""/>
<input type="button" name="select" value="选择..." onClick="javaScript:winOpen('list.html','列表',600,400)">

<input type="button" name="select" value="提交" onClick="javaScript:save()">
</from>
</body>
</html>

 

 

 

 

 

 

 

 

 

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
<title></title>
<script type="text/javascript">
function checkIt(){
window.opener.document.getElementById("tid").value = document.getElementById("dicId").value; //把子窗口的值,赋值给父窗口
window.opener.document.getElementById("tname").value = document.getElementById("dicName").value; //把子窗口的值,赋值给父窗口
window.close();
}
function getDicName(dicId,strDicName){
document.getElementById("dicId").value = dicId;
document.getElementById("dicName").value = strDicName;
}
</script>
</head>
<body>
<from action="xx.action" method="post" id="myform" name="myform">
<input type="hidden" name="dicId" id="dicId">
<input type="hidden" name="dicName" id="dicName">

<INPUT TYPE="radio" NAME="type" οnclick="getDicName('1','行政部')">行政部
<INPUT TYPE="radio" NAME="type" οnclick="getDicName('2','人事部')">人事部
<INPUT TYPE="radio" NAME="type" οnclick="getDicName('3','财政部')">财政部
<INPUT TYPE="radio" NAME="type" οnclick="getDicName('4','研发部')">研发部
<INPUT TYPE="radio" NAME="type" οnclick="getDicName('5','产品部')">产品部

<br/>
<input type='button' name='create' value=" 确 认 " onClick="javascript:checkIt()">
<input type='button' name="cancel" onClick="javaScript:window.close()" value=" 取 消 ">

</from>
</body>
</html>

转载于:https://www.cnblogs.com/lyming/p/3924958.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值