Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82314

Uncaught TypeError: Cannot read property 'submit' of undefined

$
0
0

cropping.it/Server_side_process_datatable/index.php

Hi,
I have put an URL in the CF_PIVA field, which should open a new page once it is clicked. Now i have two problems:
1- when i try to open the link, the frm.submit returns the error (Uncaught TypeError: Cannot read property 'submit' of undefined).
2- How can i see row of the table in the new page?
Is there someone who can give me some advice? Thank you

 <form id="frm-main" action=""  method="POST">
       <input type="hidden" name="CF_PIVA" value="">


$(document).ready(function() {
      var table = $('#AZIENDE_TEST').DataTable({
         "processing": true,
          "serverSide":true,
        "ajax": {
          url: "data.php"
        },
        columnDefs: [{
          targets: 9,
          render: function(data, type, row, meta) {
            if (type === 'display') {
              data = '<a class="link-post" href="http://cropping.it/Server_side_process_datatable/index.php/'+data+'" >' + data + '</a>';
            }
            return data;
          }
        }]
      });
      // Handle click on link in the table
      $('#AZIENDE_TEST').on('click', '.link-post','_blank', function(e) {
        e.preventDefault();

        // Get row data
        var data = table.row($(this).closest('tr')).data();

        var form = $('#frm-main').get(9);

        // Update form action URL if needed
         // form['action'] = this.href;

        // Set required form parameters
         // form['name'].value = data[9];

        // Submit form
        this.form.submit();
      });
    });
    </script>

Viewing all articles
Browse latest Browse all 82314

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>