Chenna Rao Chenna Rao - 5 months ago 25
jQuery Question

How to get asp.net gridview entire cell values inside html textbox onchange="return Calculations(this);" jQuery function

I am trying to inside gridview html textbox values enter, when it loses focus(mean jQuery

onchange="return fuction()"
) side I would like to know which row of the table it is in. Mean that entire cell values detail required any idea ?

<asp:TemplateField HeaderText="Adjusting time(HH:MM:SS)">
<ItemTemplate>
<div class="form-group">
<div class="col-md-3">
<input id="txtHours" runat="server" type="text"
class="form-control" placeholder="HH"
onkeypress="CheckNumeric(event);"
onchange="return Calculations(this);" />
</div>
<div class="col-md-3">
<input id="txtMinutes" runat="server" type="text"
class="form-control" placeholder="MM"
onkeypress="CheckNumeric(event);"
onchange="return Calculations(this);" />
</div>
<div class="col-md-3"></div>
</div>
</ItemTemplate>
</asp:TemplateField>

Answer

enter image description here

 function Calculations(elem) {
            var TabChangeId = $(elem).attr("id");
            if (TabChangeId == "txtHours") {
                var CurrentNode = $(elem).parent().parent().parent().parent();
                var EmpName = CurrentNode.find('#lblEmployeename').text();
    }

click of hours or minutes and seconds get that row values.