如何显示和隐藏使用jquery选中的复选框上的按钮 [英] How to show and hide button on checkbox checked with jquery
本文介绍了如何显示和隐藏使用jquery选中的复选框上的按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个带有checkBox的ListView(从数据库中删除多条记录)我希望当用户选中复选框时我的删除按钮将显示show else display hide
我的源代码是
I have a ListView with checkBox (to delete multiple record from database) i want when user check to checkbox my delete button will be display show else display hide
my source code is
<asp:ListView ID="lvImages" runat="server" GroupItemCount="8"
onpagepropertieschanging="ListView1_PagePropertiesChanging"
onitemcommand="lvImages_ItemCommand">
<EmptyDataTemplate>
<h2>Currently images not available for this album.</h2>
</EmptyDataTemplate>
<LayoutTemplate>
<table style="width:100%; border:1px solid gray;" id="tblNewsHeading">
<tr ID="groupPlaceholder" runat="server">
</tr>
</table>
</LayoutTemplate>
<GroupTemplate>
<tr>
<td ID="itemPlaceholder" runat="server">
</td>
</tr>
</GroupTemplate>
<ItemTemplate>
<td>
<asp:HyperLink ID="hlnkImg" CssClass="fancybox" NavigateUrl='<%# Eval("imgPath") %>' runat="server" data-fancybox-group="gallery" title='<%# Eval("imageTitle") %>' >
<asp:Image ID="Image1" CssClass="galleryImg" ImageUrl='<%# Eval("thumbPath") %>' ToolTip="Click here to view full size." runat="server" />
</asp:HyperLink><br />
<asp:Label ID="lblTitle" runat="server" Visible="false" Text='<%# Eval("imageTitle") %>' />
<asp:Label ID="lblOrgImage" runat="server" Visible="false" Text='<%# Eval("orgImgPath") %>' />
<asp:Label ID="lblImageId" runat="server" Visible="false" Text='<%# Eval("imgId") %>' />
<asp:CheckBox ID="chkbDelete" Text="Delete" CssClass="lnkbtnFontSize" runat="server" />
<asp:LinkButton ID="lbtnEdit" CssClass="chkbox" runat="server" Text="Edit" CommandArgument='<%# Eval("imgId") %>' CommandName="EditImage" />
</td>
</ItemTemplate>
<GroupSeparatorTemplate>
<tr id="Tr1" runat="server">
<td colspan="3"><hr /></td>
</tr>
</GroupSeparatorTemplate>
</asp:ListView>
<span style="float:right">
<asp:Button ID="btnDelete" runat="server" Text="Delete"
ToolTip="Select checkbox to delete images" onclick="btnDelete_Click" OnClientClick='return confirm("Are you sure you want to permanently delete selected image .?");' />
</span>
推荐答案
复选框检查 [ ^ ]
嗨frnd,
我希望下面的脚本会给你解决方案,
Hi frnd,
I hope below script will give u the solution,
(' #<%= chkbDelete.ClientID%>')。change( function (){
if (
('#<%=chkbDelete.ClientID %>').change(function(){ if (
这篇关于如何显示和隐藏使用jquery选中的复选框上的按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文