Export to Excel error. Using body function to get details from input fields. Error thrown.
Export to Excel error. Using body function to get details from input fields. Error thrown.

Link to test case: http://live.datatables.net/saxemiza/2/
Error messages shown: Uncaught Error: Syntax error, unrecognized expression: (Tiger Nixon
Description of problem: I'm trying to export to Excel. This worked fine before I implemented the method described here to deal with input fields:
https://datatables.net/extensions/buttons/examples/html5/outputFormat-function.html
You can see a testable version of the problem at the top. Now the export will fail on the first field in which it finds any special characters.
I believe this problem has been seen before but a testable case was not provided:
https://datatables.net/forums/discussion/62143/in-jquery-datatable-export-to-excel-showing-error-uncaught-error-syntax-error-unrecognized-expres
https://datatables.net/forums/discussion/48640/syntax-error-unrecognized-expression-10-20-21-while-exporting-excel-or-pdf
I think this may only be an issue when the underlying data is DOM? Any help really appreciated.
Many thanks
Tom
Answers
You're treating the data as a node, which it isn't, hence the odd results. Try changing your line to be:
see here - http://live.datatables.net/saxemiza/3/edit
Colin