Hi,
I have assigned values to the label using javascript when i click on button all lable values clears.
But i want to fetch all label values on button click.
so please suggest me proper solution.
$(function () {
GetCustomers(1);
$("[id*=gvCustomers] tr").click(function () {
//Selected Row.
var selectedRow = $(this).closest('tr');
//In eq(0) portion you need to mention the cell number.
var plid = $(selectedRow).find('td').eq(0).html();
var plsource = $(selectedRow).find('td').eq(1).html();
var pldest = $(selectedRow).find('td').eq(2).html();
var plttype = $(selectedRow).find('td').eq(3).html();
var plsdate = $(selectedRow).find('td').eq(6).html();
var plcontact = $(selectedRow).find('td').eq(8).html();
$('[id*=txtsmsid]').html(plid);
$('[id*=lblsource]').html(plsource);
$('[id*=lbldest]').html(pldest);
$('[id*=lbltrucktype]').html(plttype);
$('[id*=lbldate]').html(plsdate);
$('[id*=lblcontact]').html(plcontact);
$('[id*=btnsendMsg]').show();
});
});
<div class="PageDesc">
<div class="form-group">
<div class="col-md-1">
<asp:Label ID="lblmsg" runat="server" ForeColor="Green" Font-Bold="true" Text="Message : "></asp:Label>
</div>
<div class="col-md-10">
<p>
<asp:Label ID="lblsource" runat="server"></asp:Label>
To
<asp:Label ID="lbldest" runat="server"></asp:Label>
<asp:Label ID="lblttype" runat="server"></asp:Label>
Date:<asp:Label ID="lbldate" runat="server"></asp:Label>
Contact:<asp:Label ID="lblcontact" runat="server"></asp:Label>
</p>
</div>
<asp:Label ID="lblsuccess" runat="server" ForeColor="Green" Font-Bold="true" Text="SMS SENT SUCCESSFULLY !" Visible="false"></asp:Label>
</div>
</div>
I am assigning gridview selected row cells values to the label, then i want to send label values to mobile through SMS on button click.