Here is my code, then i will ask my question below.
var GridView = document.getElementById('<%=gridUploads.ClientID %>')
if (GridView.rows.length > 0) {
for (var i = 1; i < GridView.rows.length; i++) {
var modal = GridView.rows[i].getElementById('<%= myModal.ClientID %>')
}
My modal decoration is in an item-template in a c# grid-view called gridUploads. I would like to find the modal control in javascript, how would i do this?
the control i am trying to grab is
1. a modal
2. other elements like an input, img etc.
if i can figure out how to find the modal, i can pretty much figure the rest out.
here is the declaration of the elements, if you feel it would help.
<ItemTemplate>...
<asp:Panel ID="pnluploads1" runat="server">
<div class="scans-container">
<div class="scanimage">
<input class="hideelement toggle" id="'<%#Container.DataItemIndex.ToString() %>'" type="checkbox" checked="checked">
<label class="lblscanImg" for="'<%#Eval("ClientOrderNo") %><%#Container.DataItemIndex.ToString() %>'"> view scan</label>
<div id="expand">
<img id="myImg" src="../../img/test.jpg" width="300" height="200">
</div>
</div>
</div>
<div id="myModal" class="modal">
<span class="close">×</span>
<img class="modal-content" id="img01" src="#">
<div id="caption"></div>
</div>
...
</ItemTemplate>
thanks so much for your help.
What I have tried:
I have tried
1) var modal = GridView.rows[i].getElementById('myModal');
2) var modal = document.getElementById('<%=((gridUploads)Container).FindControl("myModal").ClientID %>');