Put tabs's table data into database

Put tabs's table data into database

kantorgkantorg Posts: 2Questions: 0Answers: 0
edited December 2012 in General
Hi!

Firstly I'd like to tell that this datatable is awesome!!!
I use tabs, in each tab there is one table. I would like to select one row from each table and put all data into mysql database.
I get data from each table with the following code:
[code]
// Selection 1
kivberlok = $('#berlok').dataTable();
kivberlok.$('tr').click( function () {
var data = kivberlok.fnGetData( this );
document.getElementById('kolcsonzokod').innerHTML =
('Selected thing 1: ') +
data[1] +
('');
} );

// Selection 2
kivgepek = $('#gepek').dataTable();
kivgepek.$('tr').click( function () {
var data = kivgepek.fnGetData( this );
document.getElementById('gepektarto').innerHTML =
('Selected thing 2: ') +
data[1] +
('');;
} );
[/code]

As you can see it gives me back separate forms with 2 submt button. The selected data appear in two div with id 'kolcsonzokod' and 'gepektarto'.
My goal is to select rows from any number of table every selected items show up below the table and by clicking one submit button every selected data go to database.


Thank you for your response!

Replies

  • girishmrgirishmr Posts: 137Questions: 0Answers: 0
    This can be done in many ways.
    One of them is -

    Create one table / form with combined columns / fields (later server side script has to decipher the data for respective tables ), keep adding the selected rows to one single table / form (club the fields of each table into individual div's wrapped in a form) . When done just submit.
  • kantorgkantorg Posts: 2Questions: 0Answers: 0
    Thanks for your help.
    I don't really understand what to do exactly but I try.
This discussion has been closed.