How to check data before submiting?

How to check data before submiting?

PiterskuyPiterskuy Posts: 5Questions: 0Answers: 0
edited September 2013 in General
I have 11th column in my datatable that edit with jEditable. But I want to edit this:
1. after checking 12th column that it is not null (comment for editable value)
OR
2. after typing some text in popup window (comment for editable value)

How can I check this or call popup window before submiting? Any ideas =)

[code]
var oTable;

oTable =$('#example').dataTable( {

"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "inc/server_processing_urv.php",

"aoColumnDefs": [
{ //Hiding columns
"bVisible": false, "aTargets": [ 7,9]
} ],
//Editing
"fnDrawCallback": function () {
$('td:nth-child(11)', this.fnGetNodes()).editable( 'editable_ajax.php', {//11 column edit
"callback": function( sValue, y ) {
var aPos = oTable.fnGetPosition( this );
oTable.fnUpdate( sValue, aPos[0], aPos[1] );
},
"submitdata": function ( value, settings ) {
return {"row_id": oTable.fnGetData( this.parentNode )[0],
"column": oTable.fnGetPosition( this )[2]
};
alert( 'DataTables has redrawn the table' );
},
"height": "14px",
"onblur":'submit'
} );
}
[/code]

Replies

  • PiterskuyPiterskuy Posts: 5Questions: 0Answers: 0
    I would be grateful, any ideas?
  • PiterskuyPiterskuy Posts: 5Questions: 0Answers: 0
    Found this http://jqueryvalidation.org/validate/

    The last question is how to link 2 parameters in one row. When submitting the first parameter also check the another one?

    [code]
    onsubmit: function (settings, original) {
    var myForm = $(this, original); //<-- the cell (td[10]) where I want to input value
    $(myForm).validate({ //I need to check the cell td[11] if it's not NULL
    rules: {
    value: {
    min: 0.5,
    max: 24
    }
    },
    messages: {
    value: {
    min : 'more or equal 0.5',
    max : 'less or equal 24'
    }
    },
    onkeyup: false
    });
    return $(this, original).valid();
    }
    [/code]
  • PiterskuyPiterskuy Posts: 5Questions: 0Answers: 0
    The main idea now is to use rendering when printing out the table.

    Attention please. it's Hardcore!

    Example:
    [code]
    { "aTargets": [ 12 ],
    "mRender": function ( data, type, full ) {
    return '';
    }
    }
    [/code]
    and so on

    But I still don't know how to send this data to php script like in the first post in the background.
  • PiterskuyPiterskuy Posts: 5Questions: 0Answers: 0
    So I used this http://code.google.com/p/jquery-datatables-in-line-editing/downloads/detail?name=CreativePathExample.zip&can=2&q=
This discussion has been closed.