var str="selectbusinessunit.aspx?unitid="+unitid.value;
function selectunit() {
var unitid = $("#txtBunitid");
var str = "WebForm1.aspx?unitid=" + unitid.value;
var result = window.showModalDialog(str, '', 'dialogWidth=35;dialogHeight=31;resizable=no;scroll=no;status=no');
if (result != null && result != "")//保存失败
{
var name = result.split('|')[0];
var id = result.split('|')[1];
$("#tb_departID").val(name);
$("#txtBunitid").val(id);
}
}
var result= window.showModalDialog(str,'','dialogWidth=35;dialogHeight=31;resizable=no;scroll=no;status=no');
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server"> <title></title> </head> <script type="text/javascript"> var returnValue = ""; function SelectProduct() { var products = document.getElementsByName("product"); for (var i = 0; i < products.length; i++) { if (products[i].checked == true) { returnValue += products[i].value; } } window.returnValue = returnValue; alert(window.returnValue); window.close(); } </script> <body> <form id="form1" runat="server"> <div> <input name="product" id="Checkbox1" type="checkbox" value="中华人民共和国" /> 中华人民共和国<br /> <input name="product" id="Checkbox2" type="checkbox" value="中国"/>中国 <br /> <input name="product" id="Checkbox3" type="checkbox" value="联合国"/>联合国 <input id="Button1" type="button" value="button" onclick="SelectProduct()"/> </div> </form> </body> </html>