I'm having issues when loading & submitting data with certain characters

I'm having issues when loading & submitting data with certain characters

cj1005cj1005 Posts: 142Questions: 45Answers: 1

Hi,

Some of the characters I'm having issues with:

= When submitting data, this results in any text prior to the equals being cut off (incl the equals).
| When submitting the data, this results in a 'system error has occurred' message at the bottom of my editor form.
\ When loading the data, this results in an invalid JSON format message.

From what I have read, it sounds like I need to escape\encode the data, but I'm unsure how to do this when submitting and loading data respectively.

Would I need to use encode when submitting and then decode prior to loading the data?

Or maybe\hopefully datatable's has a parameter I can set to do this for me :wink:

Any advice greatly appreciated.

Cheers, Chris

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,214Questions: 1Answers: 10,415 Site admin

    Hi Chris,

    What is the response from the server when this happens? Hopefully it will contain an error message.

    Also, what is your server-side environment here? Are you using PHP with MySQL and our Editor libraries for example? Or something else?

    Thanks,
    Allan

  • cj1005cj1005 Posts: 142Questions: 45Answers: 1

    Hi Allan,

    I've had to write my own server-side environment, due to our existing legacy systems & my lack of knowledge.

    So, am I right in thinking, datatables has no known issues with these (or any other) characters and the problem is most likely server-side? If so, that would be great to know and I can investigate my server-side.

    Cheers, Chris

  • allanallan Posts: 63,214Questions: 1Answers: 10,415 Site admin
    Answer ✓

    I’m not aware of any issue like what you describe. To double check, making sure you are getting the full string in the POST data from the client (i.e. before ANY processing is done on it). It sounds to me like something might be trying to evaluate the string as a formula - similar to what Excel does when you start with a =.

    If you are able to give me a link to your page, I’d be able to confirm if Editor is submitting the full data correctly and that it isn’t (or is, if is the case!) a client-side issue.

    Allan

  • cj1005cj1005 Posts: 142Questions: 45Answers: 1

    Hi Allan,

    You were spot on it was my server-side code causing the issue.
    Thank you for pointing me in the right direction.

    Cheers, Chris

This discussion has been closed.