How to validate data in the table while editing

How to validate data in the table while editing

samir_gamblersamir_gambler Posts: 5Questions: 0Answers: 0
edited December 2013 in DataTables 1.9
Hi,
I am using DataTablles to make editable table and allow user to edit the data. I can achieve this but how to validate the data entered by the user during editing.
Thanks,
Samir

Replies

  • allanallan Posts: 63,494Questions: 1Answers: 10,470 Site admin
    Hi Samir,

    What are you using to do the editing? Is it DataTables Editor? Validation in Editor is done when the form is submitted, so the server can do full validation. Are you looking to add on-the-fly validation as well?

    Allan
  • samir_gamblersamir_gambler Posts: 5Questions: 0Answers: 0
    Hi Allan,
    Thanks for the response. I am not sure if it is DataTables Editor. I have got the template which I have been asked to modify. It has function like this
    [code]
    function saveRow(oTable, nRow) {
    var jqInputs = $('input', nRow);
    var aData = oTable.fnGetData(nRow);
    var stats = $('#status').val();
    oTable.fnUpdate(jqInputs[0].value, nRow, 1, false);
    oTable.fnUpdate(jqInputs[1].value, nRow, 2, false);
    oTable.fnUpdate(jqInputs[2].value, nRow, 3, false);
    ...
    ..
    .
    [/code]
    I have some fields like email ID which I want to validate client side.

    Thanks,
    Samir
This discussion has been closed.