jquery - Can't submit a form using DataTables -
jquery - Can't submit a form using DataTables -
i have form , when remove datatables, it's working properly. when set <table id='example'> utilize datatables, not submit form. if set echo form_open before ` doesn't work properly, inserts teacher_id=13, not different row, i've chosen. that's view:
class="snippet-code-html lang-html prettyprint-override"><html> <head> <link href="//cdn.datatables.net/1.10.5/css/jquery.datatables.css" rel="stylesheet" type="text/css" /> <script src="http://code.jquery.com/jquery-2.0.3.min.js"></script> <script src="http://code.jquery.com/jquery-1.11.1.min.js"></script> <script src="http://code.jquery.com/jquery-2.1.0.min.js"></script> <script src="//cdn.datatables.net/1.10.2/js/jquery.datatables.js"></script> <script src="//cdn.datatables.net/1.10.2/js/jquery.datatables.js"> <script src="../../media/js/datatables.editor.min.js"></script> <script> $(document).ready(function() { $('#example').datatable( { "pagingtype": "full_numbers", "bsort": true, "sdom": 't<"clear">lfrtip', // "pagingtype": "scrolling", "tabletools": { "sswfpath": "http://cdn.datatables.net/tabletools/2.2.2/swf/copy_csv_xls_pdf.swf", "abuttons": [ "csv", { "sextends": "pdf", "sbuttontext": "print pdf", "mcolumns": "visible" }, "xls" ] } } ); } ); </script> <script> $(document).ready(function() { $('#example tfoot th').each( function () { var title = $('#example thead td').eq( $(this).index() ).text(); $(this).html( '<input type="text" placeholder="search '+title+'" />' ); } ); var table = $('#example').datatable(); table.columns().eq( 0 ).each( function ( colidx ) { $( 'input', table.column( colidx ).footer() ).on( 'keyup change', function () { table .column( colidx ) .search( this.value ) .draw(); } ); } ); } ); </script> <?php echo validation_errors(); ?> <table id='example'> <thead> <tr> <th>teachers</th> <th>coord.</th> <th>change coord.</th> <th>deactivate teacher</th> </tr> </thead> <tfoot> <tr> <th>teachers</th> <th>coord.</th> <th>change coord.</th> <th>deactivate teacher</th> </tr> </tfoot> <tbody> <?php foreach ($teachers_show $teacher) { echo form_open('coordinator/deactivate_teacher'); ?> <tr> <td> <?php echo $teacher->username; ?> </td> <td> <?php echo $teacher->coordinator_id; ?> </td><td> <?php echo '<a href="edit_coordinator/' . $teacher->user_id . '" class="btn btn-success" id="change_coord"> alter </a>'; ?> </td><td> <?php echo "<input type='hidden' name='teacher' value='$teacher->user_id' />"; echo '<input type="submit" name="deactivate" value="Деактивирай учител" id="change_coord" class="btn btn-danger" onclick="return confirm(\'are sure want deactivate?\'); " />'; ?> </td></tr> <?php echo form_close(); } ?> </tbody> </table> </div> </body> </html>
jquery forms datatables submit
Comments
Post a Comment