0

I am trying to get my nested ListView's (ListView within a ListView) textbox with Javascript. This is what I have set up in my ListViews:

<asp:ListView ID="LV_Tickets" runat="server" DataSourceID="SQL_Tickets" InsertItemPosition="FirstItem" OnPreRender="LV_Tickets_PreRender" DataKeyNames="TicketNum">
<SelectedItemTemplate>
<asp:ListView ID="LV_TicketProd" runat="server" DataKeyNames="ChargeID" DataSourceID="SQL_TicketProducts" InsertItemPosition="LastItem" OnPreRender="LV_TicketProd_PreRender" OnItemInserted="LV_TicketProd_ItemInserted" OnItemInserting="LV_TicketProd_ItemInserting" OnItemUpdated="LV_TicketProd_ItemUpdated" OnItemUpdating="LV_TicketProd_ItemUpdating" OnItemCommand="LV_TicketProd_ItemCommand">
</ SelectedItemTemplate>

I am aware that to get LV_Tickets I can call getElementByName, but after that I am lost and cannot find any help on the subject. How should I go about this?

1
  • can you show id of TextBox Using FireBug Commented Jan 1, 2015 at 5:27

1 Answer 1

1

You can directly get the nestedlistview by id if you know id

var nestedlistview=document.getElementById("LV_TicketProd");

And if you do not know id of nestedlistview than you can get it by it's parent'd id

var listview=document.getElementById("LV_Tickets");
var nestedListView=listview.querySelector("#LV_TicketProd");
Sign up to request clarification or add additional context in comments.

1 Comment

So how would I go about getting and setting the value of a textbox that is inside this listview?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.