how to get changed fields in the presubmit event handler
how to get changed fields in the presubmit event handler
zyq105
Posts: 17Questions: 4Answers: 0
In the editor preSubmit event handler, I want to display the field XYZ which value has been changed.
editor.on('preSubmit', function (e, data, action) {
// here I need to find the list of column names XYZ ... which value has been changed
return confirm("The cloumns [XYZ, ...] have changed value, Are you sure want to submit the change?");
});
This discussion has been closed.
Answers
Take a look at this:
https://datatables.net/forums/discussion/comment/178033#Comment_178033
Instead of stringifying the fields you can look at them individually. Instead of "preBlur" you could use "preSubmit"
It helps. Thanks!
forgot to mention: If you want to compare the Editor form values I wouldn't use "preSubmit" because at that point in time the form is no longer available which makes it a bit tricky.
Just use "initSubmit" because then you can compare the form fields.
Here is an an example from my own coding in which I compare the value of just one field which I save in a global variable on "initEdit" and then check on "initSubmit".
Cool! Good info.