Click here to Skip to main content
15,895,142 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi..

how to fetch textbox id in gridview which is dynamically created using jquery??
Posted

Suppose your dynamically created gridview has an ID i.e. Gdv1 then:-

use this:-


$(function(){
$('#Gdv1').find('input[type="txt"]').attr('id');
});

This will solve your problem. For any queries plz ask???
 
Share this answer
 
Comments
Member 10276220 5-Dec-13 1:02am    
your code is not working....
this is my code...but its not working....

<script type="text/javascript">
function automember(eval) {


debugger;

$(".abc").autocomplete({
source: function (request, response) {
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "/InputSheet.aspx/GetAutoCompleteMember",

data: "{'selCo':'" + document.getElementById('txtmember').value + "'}",

dataType: "json",
success: function (data) {
response(data.d);
},
error: function (result) {
alert("Error");

}
});
}
});

}


</script>



this is the gridview design:

<asp:GridView ID="grdview" runat="server" AutoGenerateColumns="false" ShowFooter="true" Width="600px" OnRowDataBound="grdview_RowDataBound" >



<columns>

<asp:TemplateField HeaderText="Member Name">
<itemtemplate>

<asp:TextBox ID="txtmember" runat="server" CssClass="abc" AutoPostBack="true" onkeyup="automember(this)">


Plz use $('#<%=txtmember.ClientID%>').val() in place of document.getElementById('txtmember').value

Hope it will help u...
 
Share this answer
 
Comments
Member 10276220 5-Dec-13 9:41am    
hi Jain Nishant..
i am getting error after " $(".abc").autocomplete({ "

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900