how can i send a row in to a form?

how can i send a row in to a form?

lapolapo Posts: 1Questions: 1Answers: 0
edited April 2020 in Free community support

ive wrote a code that use some dataTables function to intercept the click of an user on a specific row:

$(document).ready(function(e) {
        $('#patients').DataTable({
            responsive: true,
            fixedColumns:   true,
            columnDefs: [
                {
                    targets: "_all",
                    className: 'dt-body-center'
                }
            ]
        });
        var table = $('#patients').DataTable();
        $('#patients tbody').on('click', 'tr', function () {
            var data = table.row( this ).data();
            if (window.confirm( 'Stai per accedere ai dettagli di: '+data[0]+'' )) {
             //HERE I NEED A WAY TO LOAD AND SUBMIT A FORM
            }

            ;
        } );

    });

so i insert a hidden form on each row of the table, how can I fetch the form in this context without a specif id?
thanks

Answers

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

This discussion has been closed.