0

我想在弹出屏幕中显示复选框按钮选择的结果:例如,如果我从下面选择:A.空调和e。洗碗机。我想要一个弹出屏幕,上面写着“您已选择空调和洗碗机”,单击按钮即可显示,我们称之为“显示”。

       <table name="BuyProduct" id ="BuyProduct_H" style="width:100%;" >

        <tr>                
            <td class="auto-style2" colspan="3">1-&nbsp;&nbsp;&nbsp;&nbsp; What were the products that you bought?          </tr>
        <tr>
            <td class="auto-style53"></td>
            <td colspan="2" class="auto-style54">
                <input id="cbconditioning" type="checkbox"  onclick="Chosen()" />a. Air Conditioning</td>
        </tr>
        <tr>
            <td class="auto-style28">&nbsp;</td>
            <td colspan="2">
                <input id="cbradio" type="checkbox"  onclick="Chosen()"/>b. TV Radio (TV, Home Theatre, etc.)</td>
        </tr>
        <tr>
            <td class="auto-style28">&nbsp;</td>
            <td colspan="2">
                <input id="cbrefrigeration" type="checkbox"  onclick="Chosen()"/>c. Refrigeration</td>
        </tr>
        <tr>
            <td class="auto-style28">&nbsp;</td>
            <td colspan="2">
                <input id="cblaundry" type="checkbox"  onclick="Chosen()"/>d. Laundry (Washer, Dryer, etc)</td>
        </tr>
        <tr>
            <td class="auto-style28">&nbsp;</td>
            <td colspan="2">
                <input id="cbdishwasher" type="checkbox"  onclick="Chosen()" />e. Dishwasher</td>
        </tr>
        <tr>
            <td class="auto-style28">&nbsp;</td>
            <td colspan="2">
                <input id="cbtreatment" type="checkbox"  onclick="Chosen()"/>f. Water Treatment (Water Dispencer)</td>
        </tr>
        <tr>
            <td class="auto-style57"></td>
            <td colspan="2" class="auto-style58">
                <input id="cbhousewares" type="checkbox"  onclick="Chosen()"/>g. Small Housewares (Microwave, Kitchen appliances, etc.)<br />
            </td>
        </tr>
        <tr>
            <td class="auto-style59"></td>
            <td colspan="2" class="auto-style60">
                <input id="cbothers" type="checkbox"  onclick="Chosen()"/>h. Others Please Specify</td>
        </tr>
        <tr>
            <td class="auto-style28">&nbsp;</td>
            <td class="auto-style51"></td>
            <td>
    <asp:TextBox ID="TextBox26" runat="server"></asp:TextBox>
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="auto-style28">&nbsp;</td>
            <td colspan="2">
                &nbsp;</td>
        </tr>
        <input type="button" id="chosenlaunch" onclick="Chosen()" value="Equipments Purchased"/>
        </table>

这是迄今为止我工作的脚本,但它显示了多个弹出窗口,而不是一个包括所有检查结果的弹出窗口:

  function Chosen() {
        if (document.getElementById('cbconditioning').checked == true) {
            alert("You Chose Air Conditioning");
        }
         if (document.getElementById('cbradio').checked == true) {
            alert("You Chose Radio");
        }
         if (document.getElementById('cbrefrigeration').checked == true) {
            alert("You Chose Refrigeration")
        }
         if (document.getElementById('cblaundry').checked == true) {
            alert("You Chose Laundry")
        }
         if (document.getElementById('cbdishwasher').checked == true) {
            alert("You Chose Dishwasher")
        }
         if (document.getElementById('cbtreatment').checked == true) {
            alert("You Chose Treatment")
        }
         if (document.getElementById('cbhousewares').checked == true) {
            alert("You Chose Housewares")
        }
         if (document.getElementById('cbothers').checked == true) {
            alert("You Chose Others")
        }

    }
4

1 回答 1

0

您可以使用jquery对话框来实现它,方法有很多,我在这里不给出我的代码而是给你链接,试试这个

jQuery 对话框

于 2013-10-24T08:03:54.990 回答