Using Forms with elements in each row and outside the table

Using Forms with elements in each row and outside the table

oneseventeenoneseventeen Posts: 2Questions: 0Answers: 0
edited March 2011 in General
I am attempting to use DataTables to make part of a form easier to navigate. (and I love it, awesome work!)

Here is what I'm doing so far:

[code]$(document).ready(function() {
$('#form').submit(function() {
var sData = $('input', oTable.fnGetNodes()).serialize();
//do stuff with sData
return false;
});

oTable = $('#zreport').dataTable();
} );[/code]

The table is simple but has a few input fields in each row. Here's a sample since my table is rather large:
[code]





Deposit?
Amount
Corrected Amount





$461.00
$



$46.00
$



$61.00
$



$41.00
$



Deposit #:


[/code]

I have several pages of data, so I have to use fnGetNodes();

how can I also pull all other input fields that are outside the table?

Thank you in advance if you are able to help. (whoever is available) :)

Replies

  • oneseventeenoneseventeen Posts: 2Questions: 0Answers: 0
    As usual, posting a discussion was all I needed to do to figure it out...
    Here's what I'm doing now:
    [code]
    $(document).ready(function() {
    $('#form').submit(function() {

    //get the data from my TableData Table.
    var sData = $('input', oTable.fnGetNodes()).serialize();

    //get the data from the form
    var fData = $(this).serialize();

    //squish them together
    sData = sData + '&' + fData;

    //Do stuff with it
    alert(sData);
    return false;
    });

    oTable = $('#zreport').dataTable();
    } );
    [/code]
    Now the Table:
    [code]

    **snip for space**


    **additional fields**
    **submit button**

    [/code]

    Hope this helps someone else!
This discussion has been closed.