Removing non JSON Characters from fields
Removing non JSON Characters from fields
Hi, I am using DataTables and DataTables Editor in a large project of mine and was curious if there was a way to remove the non json characters such as tabs, etc from the form fields before submitting to the server. Users of my project are placing them into the text boxes and I would like to remove them on the client side.
What is the fastest way to implement this for many tables and editors? I have checked the reference and cannot seem to find anything to solve this. Is it built in?
Answers
I'm not sure that there is such a thing as a "non-JSON character". Tabs etc are perfectly valid inside a JSON string.
Having said that, you could use
preSubmit
to modify the data before submitting to the server, or probably better would be to use a server-side formatter.Allan