How to Catch The Value of Label Through JQuery

Posted by Anweshabhowmick under jQuery on 12/23/2011 | Points: 10 | Views : 2205 | Status : [Member] | Replies : 0
I have a label in GridView and i want the label value through JQuery..Please ANyone Help Me...............

Here is my Code
/*Jquery to catch the valu of label and textbox*/
$(".click").click(function() {
var hidnfldid = '<%= HiddenField1.ClientID %>';
var grisid = '#<%=gvreqdtl.ClientID %> ';
document.getElementById('<%= HiddenField1.ClientID %>').value = '';
alert(Getgv_Data(grisid));
document.getElementById('<%= HiddenField1.ClientID %>').value = Getgv_Data(grisid);
});

/*Grid view Label*/
<asp:TemplateField Visible="false">
<ItemTemplate>
<asp:Label ID="lblvendorid" runat="server" Text='<%# Eval("vendor_id") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>

/* Jquery Function*/

function Getgv_Data(grisid) {
var x = '';
var $grid = $(grisid);
$grid.find('tr').each(function() {
$(this).find('td').each(function() {
$(this).find('select').each(function() {
if ($(this).val() != '0')
{
x = x + $(this).find('option:selected').val() + '?';
}
});
$(this).find("input").each(function() {
x = x + $(this).val() + '?';
});
});
x = x + '|';
x = x.replace("?|", "|");
});
//alert(x)
return x;
}


Please Help Me.................




Responses

(No response found.)

Login to post response