How to check data before submiting?
How to check data before submiting?
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]
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]
This discussion has been closed.
Replies
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]
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.