欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

JavaScript實(shí)現(xiàn)彈出子窗口并傳值給父窗口

 更新時(shí)間:2014年12月18日 11:13:48   投稿:hebedich  
這篇文章主要介紹了JavaScript實(shí)現(xiàn)彈出子窗口并傳值給父窗口,方法很簡單,這里推薦給大家,需要的朋友可以參考下

新建父窗口頁面:

加入以下腳本

復(fù)制代碼 代碼如下:

創(chuàng)建second.html頁面:

復(fù)制代碼 代碼如下:

<html xmlns=" <head runat="server">
    <title>second</title>
    <!--<base target="_self" ></base>-->
</head>
<script language="javascript">
    function closeDiag()
    {
        window.opener=null;
        window.close();
    } 
    function OK()
    {
        var Value=document.getElementsByName("myRadio");
        for(var i=0;i<Value.length;i++)
        {
            if(Value[i].checked)
            { 
                window.returnValue = Value[i].value;
                window.close();
            }
            else
            {
                document.getElementById("Lab_Info").innerText="沒有選中項(xiàng),請選擇!";
            }
        }     
    } 
</script>
<body>
    <form id="form1" runat="server">
    <div>
          <asp:DataGrid ID="dgSjygl" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                        BackColor="White" Font-Size="9pt" PageSize="5" Width="100%" Height="127px" OnItemDataBound="dgSjygl_ItemDataBound">
                        <PagerStyle Mode="NumericPages" />
                        <AlternatingItemStyle BackColor="Gainsboro" />
                        <ItemStyle BackColor="#EEEEEE" ForeColor="Black" HorizontalAlign="Center" />
                        <Columns>
                            <asp:TemplateColumn>            
                                <HeaderTemplate>
                                    <label>選擇</label>
                                </HeaderTemplate>
                                <ItemTemplate>                                   
                                    <input type="radio" id="myRadio" name="myRadio"  value='<%# DataBinder.Eval(Container.DataItem, "id") %>'>
                                </ItemTemplate>
                                <HeaderStyle Font-Bold="True" HorizontalAlign="Center" Width="60px" />
                                <ItemStyle HorizontalAlign="Center" />
                            </asp:TemplateColumn>
                            <asp:BoundColumn DataField="ID" HeaderText="編號">
                                <HeaderStyle Font-Bold="True"  Width="75px" HorizontalAlign="Center"/>
                            </asp:BoundColumn>
                            <asp:BoundColumn DataField="MC" HeaderText="名稱">
                                <HeaderStyle Font-Bold="True"  Width="90px" HorizontalAlign="Center"/>
                                <ItemStyle HorizontalAlign="Center" />
                            </asp:BoundColumn>
                            <asp:BoundColumn DataField="BT" HeaderText="標(biāo)題">
                                <HeaderStyle Font-Bold="True" HorizontalAlign="Center"/>
                            </asp:BoundColumn>
                        </Columns>
                        <HeaderStyle BackColor="#7481BA" ForeColor="Yellow" Font-Bold="False" Font-Italic="False" Font-Overline="False" Font-Strikeout="False" Font-Underline="False" Font-Size="Small" />
                    </asp:DataGrid>
    </div>
    <div>
          <input id="Btn_OK" type="button" onclick="OK()" value="確 定"/>
          <input id="Btn_Cancel" type="button" onclick="clickDiag()"  value="取 消" />
     </div>       
    </form>
</body>
</html>

以上就是本人實(shí)現(xiàn)這個(gè)簡單功能的全部內(nèi)容了,感覺應(yīng)該還有更便捷的方法,有知道的小伙伴還請留言說明下。

相關(guān)文章

最新評論