I get my fields like array with javascript. Every array field is array with proporties.
Example.
arr[0]
{
'id':'1',
'title':'testtitle',
'value': 'test value'
}
arr[1]
{
'id':'2',
'title':'testtitle',
'value': 'test value'
}
arr[2]
{
'id':'3',
'title':'testtitle',
'value': 'test value'
}
I use JSON.stringify(arr); to send array to php and to read this array.
My problem is, Value option is text form textarea. When I use simple text , I have no problem. But I need to use TinyMCE editor. When I paste some text where have html like this:
style="font-size:12px;" and other ...
Array crashed. I have no idea how to fix this.
Encode the contents of that textarea with something like Base64 first, before sending it. In PHP you can then decode and use it again.
JS (
btoa()):PHP (
base64_decode()):