如何从转发器中删除隐藏字段值 [英] How to remove hidden fields value from repeater
问题描述
今天我在一个问题上需要帮助。
这是我的JavaScript函数
Today I need help on an issue.
This is my JavaScript Function
function clickshowtick(tckclass) {
if ($('#' + tckclass).hasClass("tick_img"))
$('#' + tckclass).removeClass("tick_img");
else
$('#' + tckclass).addClass("tick_img");
if ($("#<%=hfSelectedMembeID.ClientID %>").val() == '') {
$("#<%=hfSelectedMembeID.ClientID %>").val(tckclass);
} else {
$("#<%=hfSelectedMembeID.ClientID %>").val($("#<%=hfSelectedMembeID.ClientID %>").val() + ':' + tckclass);
}
}
这是我的中继器结构
And this is my Repeater Structure
<ul class="ul-Clinical" style="margin-removed 5px;">
<asp:Repeater ID="rptAllMembers" runat="server">
<ItemTemplate>
<li class="ul_Clinical_li1" style="border: 1px solid #ccc; margin-removed 15px; width: 85px;
height: 80px;" önclick="clickshowtick('<%# Eval("TherapistStaffID")+","+ Eval("TherapistType") %>')">
<div id='<%# Eval("TherapistStaffID") %>' class="">
</div>
<div id='<%# Eval("TherapistType") %>' class="">
<asp:HiddenField ID="hfSelectedMembeID" runat="server" Value="" />
</div>
<img id="Img1" src="~/images/MessagingUser.png" runat="server" alt="MessagingUser"
style="width: 40px; margin-top: 7px;" /><br />
<asp:Label ID="lblUsername" runat="server" Style="font-size: 10px;" ToolTip='<%# Eval("FirstName") + " " + Eval("LastName") %>'
Text='<%# Eval("FirstName") + " " + Eval("LastName") %>'></asp:Label>
</li>
</ItemTemplate>
</asp:Repeater>
</ul>
我的问题是这个
当我的用户点击在一个项目上它被勾选并获得它的ID和类型。
为每个成员它给我id和类型
for a perticuler会员ID是好的
但当我勾选我的项目然后再点击它的勾选得到隐藏但该会员再次将他们的身份证给我的功能
i需要我的用户再次点击未取消选中的项目并删除其ID并从隐藏字段中输入...
因为我只需要那些被检查成员的id
如果用户取消选中它会从隐藏字段中移除其ID
plz给我一个解决方案
My issue is this
that when my user click on an item it get ticked and get its ID and type.
for every member it is giving me id and type
for a perticuler member id is ok
but when i tick my item and after that again click its tick get hide but that member give their id again to my function
i need when my user again click on an item it get unchecked and remove its id and type also from the Hidden field...
because i just need the id of those member who are checked
if user uncheck it remove its id from the hidden field
plz give me a solution
推荐答案
(' #' + tckclass).hasClass( tick_img ))
('#' + tckclass).hasClass("tick_img"))
(' #' + tckclass)。removeClass( tick_img);
else
('#' + tckclass).removeClass("tick_img"); else
(' #' + tckclass).addClass( tick_img) ;
if (
('#' + tckclass).addClass("tick_img"); if (
这篇关于如何从转发器中删除隐藏字段值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!