Send the table on PHP

Send the table on PHP

IssaIssa Posts: 16Questions: 3Answers: 0
edited July 2020 in Free community support

Hello there,
so i do this code : https://jsfiddle.net/y6ogvj05/

so when i clic on Validation i need to send all the tab on my php server_processing, can u help to understand why i can get all table info please
i think problem is here :

'''
$("#valider").click( function()
{
console.log(table.data());
}
);
'''

so how get all table info to send him on py server_precess.php ?

thanks

Answers

  • IssaIssa Posts: 16Questions: 3Answers: 0
    edited July 2020

    i found this : https://datatables.net/reference/api/toArray()

    but i don"t all table info on my array
    i do a new version : https://jsfiddle.net/qhz89evu/

    but i can't get all datatble information thanks to u

  • kthorngrenkthorngren Posts: 20,315Questions: 26Answers: 4,771

    If you want all the row data then use rows() instead of column(). I updated your example to show this:
    https://jsfiddle.net/b1qfpcvy/

    Kevin

  • IssaIssa Posts: 16Questions: 3Answers: 0

    Hello thanks,

    now the problem if i clik validate one time and i add some stuff or remove some line, when i click again on validate to get my information to php, the data is not update, but i can't get what i see,how update the tab before send him to php please

    this is my new tab : https://jsfiddle.net/xpqzogfr/2/

    thanks

  • kthorngrenkthorngren Posts: 20,315Questions: 26Answers: 4,771

    when i click again on validate to get my information to php, the data is not update

    Looking at the browser's console you are getting this error:

    jquery-3.1.0.min.js:4 POST https://fiddle.jshell.net/_display/server_processing.php 404
    Using url : 'server_processing.php', as the Ajax URL in the fiddle is not a valid path. You will need to provide a path to your PHP script that is accessible by jsfiddle.net.

    Kevin

  • IssaIssa Posts: 16Questions: 3Answers: 0

    Hello,

    thanks for u response,

    i try this on my own serveur to have the php url : 'server_processing.php',

    the code working, the problem is my jscript problem

    on my code on the javascript line :

            console.log( data );              
            $('#result').replaceWith('<p>'+data +'</p>');
    

    i don't have the same result with data console JS and the result replaceWIth,

    the replaceWith works the first time, and after when i change my datatables, i can't get the good data on my php code.

  • IssaIssa Posts: 16Questions: 3Answers: 0

    ok so i fix this jquery probléme, u have to use this fonction

     $('#result').text('<p>'+data +'</p>');
    

    i update the exemple code here : https://jsfiddle.net/9fhrw3dz/

    Ok so now need to know how to add forms to update the tab and send information to Symfony

This discussion has been closed.