如何在带有复选框按钮的 HTML 弹出窗口中显示结果
How to Display results in a pop-up screen in HTML with checkbox buttons
我想在弹出屏幕中显示复选框按钮选择的结果:例如,如果我从下面选择:A.空调和e.洗碗机。我想要一个弹出屏幕,上面写着"您已选择空调和洗碗机",只需单击一个按钮即可显示,我们称之为"显示"。
<table name="BuyProduct" id ="BuyProduct_H" style="width:100%;" >
<tr>
<td class="auto-style2" colspan="3">1- 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"> </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"> </td>
<td colspan="2">
<input id="cbrefrigeration" type="checkbox" onclick="Chosen()"/>c. Refrigeration</td>
</tr>
<tr>
<td class="auto-style28"> </td>
<td colspan="2">
<input id="cblaundry" type="checkbox" onclick="Chosen()"/>d. Laundry (Washer, Dryer, etc)</td>
</tr>
<tr>
<td class="auto-style28"> </td>
<td colspan="2">
<input id="cbdishwasher" type="checkbox" onclick="Chosen()" />e. Dishwasher</td>
</tr>
<tr>
<td class="auto-style28"> </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"> </td>
<td class="auto-style51"></td>
<td>
<asp:TextBox ID="TextBox26" runat="server"></asp:TextBox>
</td>
<td>
</td>
</tr>
<tr>
<td class="auto-style28"> </td>
<td colspan="2">
</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")
}
}
你可以
用jquery对话框来实现,有很多方法,我这里不是给我的代码而是给你链接,试试这个
"JQuery"对话框
相关文章:
- 为自定义网站创建JavaScript搜索框,创建显示搜索结果的弹出窗口
- 防止多次显示弹出窗口.Ajax添加结果已在DOM中注册
- 使用HTML搜索,需要JavaScript来搜索数组并在新窗口中返回结果
- 无法在新窗口中打开 javascript 搜索引擎结果
- 如何在带有复选框按钮的 HTML 弹出窗口中显示结果
- 如何使用 ajax 在 showModelDialog 中提交表单后在父窗口中显示结果
- 打开对话框,其中包含在使用 magnificPopup 构建的弹出窗口中跟随 URL 返回的结果
- 在jQuery窗口外使用FileReader中的结果值
- 使用AJAX结果动态更新引导弹出窗口
- 从弹出窗口中使用php和javascript传递多个MySQL结果集
- 当搜索没有结果时抛出弹出窗口
- 通过弹出窗口注册并在此弹出窗口中传递结果
- 谷歌地图信息窗口在不同的标记上给出相同的结果
- 点击弹出窗口中的按钮搜索结果
- 模态对话框返回值未定义-将结果发送到父窗口
- 在新选项卡或窗口显示表单提交的结果
- 从弹出窗口返回结果
- 使用窗口.反复打开会产生意想不到的结果
- 结合_.记住和_.节流以限制函数调用,并在一个时间窗口内缓存结果
- 无法在弹出式模式窗口中显示SQL结果