jquery - nextAll getting objects from a List View not behaving as expected -


i copied this solution make enter key behave tab one, says in post should work properly. problem focus not changing between inputs (text boxes).

the characteristics of solution following:
1. solution in added asp .net web forms application.
2. supported browser ie8
3. jquery version 1.3.1
4. there ajax update panels , script manager proxy involved.

the page in question defined follows:

<asp:scriptmanagerproxy runat="server" id="myscriptmanager">     <scripts>         <asp:scriptreference path="~/scripts/myscripts.js"/>     </scripts> </asp:scriptmanagerproxy>     <div id="content">     <asp:updatepanel runat="server" id="myupdatepanel">         <contenttemplate>             <script type="text/javascript">sys.application.add_load(ajavascriptclass.ajavascriptmethod)</script>               <div id="maindiv">                 <div id="somelist">                     <asp:listview runat="server" id="mylistview">                         <layouttemplate>                             <table width="98%">                                 <tr>                                     <th>column 1</th>                                     <th>column 2</th>                                     <th>column 3</th>                                     <th>column 4</th>                                 </tr>                                 <tr runat="server" id="itemplaceholder" />                             </table>                         </layouttemplate>                         <itemtemplate>                             <tr>                                 <td class="single-element">                                     <asp:label runat="server" id="lblcolumn1" text='<%# eval("column1") %>'></asp:label>                                 </td>                                 <td class="single-element">                                     <asp:label runat="server" id="lblcolumn2" text='<%# eval("column2") %>'></asp:label>                                 </td>                                 <td class="single-element">                                     <asp:textbox runat="server" id="txtcolumn3" text='<%# eval("column3") %>' cssclass="display-data"></asp:textbox>                                 </td>                                 <td class="single-element">                                     <asp:label runat="server" id="lblcolumn4" text='<%# eval("column4") %>'></asp:label>                                 </td>                             </tr>                         </itemtemplate>                     </asp:listview>                 </div>             </div>          </contenttemplate>     </asp:updatepanel> </div> 

the javascript file referenced in script manager proxy one:

var ajavascriptclass = {     ajavascriptmethod: function () {         $(".display-data").keydown(function (event) {             if (event.which == 13) {                 event.preventdefault();                 $(this).nextall(".display-data:first").focus();             }         });     } };  $(document).ready(function () {     ajavascriptclass.ajavascriptmethod(); }); 

so when page loaded list view empty, user , after post list view contains data text boxes. when focus on of text boxes enter key functionality blocked page not posts focus not moved next text box.

when debugging development tools in ie , looking @ contents of jquery results following:

$(this).val() - gets content of text box has focus
$(this).nextall(".display-data").val() - returns undefined
$(this).nextall(".display-data:first").val() - returns undefined
$(this).nextall().length - returns 0

there many pieces puzzle appreciated. thank you.


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -