I am using a DataTable created dynamically from a DB in which I capture the event onclick
of which row was selected and I collect your data, now what I need is that I redirect to another php file (I want to send them by POST) in which must be captured the data sent and depending on that data load certain information.
the code of js where I capture the data is this:
$('#Jtabla tbody').on('click', 'tr', function () {
if ( $(this).hasClass('selected') ) {
$(this).removeClass('selected');
dato =table.row( this ).data();
}
else {
table.$('tr.selected').removeClass('selected');
$(this).addClass('selected');
dato =table.row( this ).data();
$('<form action="proyectos.php" method="POST">' +
'<input type="hidden" name="id" value="' + dato+ '">' +
'</form>').submit();
//intente con esto pero me sale este error en consola
//Form submission canceled because the form is not connected
}
} );
Here I would believe that they should be sent by ajax, but I know that the ajax makes the request and returns, and I need to take the data there. I remain attentive, thank you very much