On my asp.net form, within a table row I add cells and within those cells I add textboxes with an attribute like -
string residentId = (new GUID()).ToString();
string houseId = (new GUID()).ToString();
HtmlTableRow detailRow = new HtmlTableRow();
detailRow.Attributes.Add("residentId", residentId);
detailRow.Attributes.Add("houseId", houseId);
HtmlTableCell dataCell = new HtmlTableCell();
TextBox tb = new TextBox();
tb.Attributes.Add("componentname", "tbMoveInDate");
tb.Attributes.Add("onchange", "updateMoveInDate()";
cell.Controls.Add(tb);
detailRow.Cells.Add(dataCell);
with a possiblility of 100+ rows, all with distinct IDs of course.
within my javascript I have this function -
function updateMoveInDate() {
var MoveInDateEle = $("[componentname*='tbMoveInDate']");
}
at this point MoveInDateEle is a collection of all of those text boxes within the table and
var currentRow = $("[componentname*='tbMoveInDate']").parent().parent();
gives me all of the rows. but not my specific row.
How is it possible to get the specific text box I am working with and the specific resident Id and house Id associated with that control?
working withmean? Will the textbox be focused? Would you mind explaining a bit more. Thanks