function radio() { var m; var n = 0; m = parseInt(document.getElementById('<%= hdfcount.ClientID %>').value); for (j = 0; j < m; j++) { var Section = "CphrEMS_dlquestions_dlsecqustns_" + j; var Sectione = document.getElementById(Section); for (k = 0; k < Sectione.rows.length; k++) { var Question = Section + "_txtqustn_" + k; var dlOption = document.getElementById(Section + "_dloptions_" + k); var txtlist = dlOption.getElementsByTagName("label"); for (l = 0; l < txtlist.length; l++) { var Option = Section + "_dloptions_" + k + "_chkanswer_" + l; document.getElementById(Option).name = k.toString(); } } } }
<asp:DataList runat="server" RepeatLayout="Table" ID="dlsecqustns"> <itemtemplate> <table width="100%"> <tr> <td align="left" width="2%" valign="top" style="padding-removed 25px;"> <asp:Label runat="server" Text='<%#Eval("qusnum") %>' ID="lblqustn"> </td> <td align="left" width="82%" style="padding-removed 25px;"> <asp:TextBox ID="txtqustn" runat="server" TextMode="MultiLine" Height="32px" CssClass="textbox" Width="70%"> <ajaxToolkit:TextBoxWatermarkExtender ID="TBWE2" runat="server" TargetControlID="txtqustn" WatermarkText="Question" WatermarkCssClass="watermarked" /> <asp:FileUpload runat="server" ID="imgqustn" /> <%--Style="display: none;"--%> <br /> <asp:DataList runat="server" RepeatLayout="Table" ID="dloptions" RepeatDirection="Horizontal" RepeatColumns="4"> <itemtemplate> <table width="99%"> <tr> <td width="25%" style="padding: 15px 0 0 0;"> <table width="100%"> <tr> <td align="left"> <asp:Label runat="server" ID="lbloptnum" CssClass="label" Text='<%#Eval("optnum") %>'><span>.</span> <asp:TextBox runat="server" TextMode="MultiLine" Width="70%" CssClass="textbox" ID="txtoptions"> <div runat="server" id="divrbtn" önclick="return radiobtn(this.id)"> <asp:RadioButton runat="server" Text="Answer" ID="chkanswer" /> </td> </tr> <tr> <td align="center" width="25%"> <br /> <input id="uploadFile" style="display: none;" class="textbx" runat="server" placeholder="Choose File" disabled="disabled" /> <div id="filediv" runat="server" style="display: none;" class="fileUpload btn btn-primary"> <span>Upload</span><input id="file" runat="server" önchange="CopyMe(this, this.id)" type="file" class="upload" /> <%--Style="display: none;"--%> <%--<asp:FileUpload runat="server" ID="file" onchange="showimagepreview(this)" />--%><%-- onchange="CopyMe(this, this.id)"--%> </td> </tr> </table> </td> </tr> </table> </itemtemplate> </td> <td> <table> <tr> </tr> <td align="left" width="8%" style="padding-removed 5px;" valign="top"> <asp:CheckBox runat="server" onClick="return visibility(this.id)" Text="image" ID="image" /> </td> <tr> <td style="padding-removed 5px;"> <asp:Button Text="AddMoreOptions" runat="server" ID="btnaddopt" OnClick="btnaddopt_Click" /> </td> </tr> <tr> <td align="left" style="padding-removed 5px;"> <asp:LinkButton ID="ClientButton" OnClientClick=" return v(this.id)" runat="server" Text="Add Question"> <ajaxToolkit:ModalPopupExtender ID="mpe" runat="server" BackgroundCssClass="modalBackground" TargetControlID="ClientButton" PopupControlID="ModalPanel" OkControlID="OKButton" /> </td> </tr> </table> </td> </tr> </table> </itemtemplate>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)