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>

これは私がこれまで取り組んできたスクリプトですが、すべてのチェック結果を含む 1 つのポップアップではなく、複数のポップアップが表示されます。

  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 に答える