So ok, I have this JSON string I'm trying to pass as a post.  From my
object's toJSON() method, I get this string:

{
    "anonymous_element_1": {
        "class": "required",
        "msg": ""
    },
    "anonymous_element_2": {
        "class": "required",
        "msg": ""
    },
    "public_phone": {
        "class": "phone",
        "value": "706-201-1149",
        "msg": ""
    },
    "private_phone": {
        "class": "phone",
        "value": "315-487-9176",
        "msg": ""
    }
}

Which is valid JSON according to http://www.jsonlint.com/ ...

However, when I try to pass this to a PHP script:

                new Ajax.Updater(this.msg, '/inc/Calendar/Validate.php',
                        {
                                'parameters':   this.toJSON()
                        }
                                                );

I get nothing passed.

However, I've noticed that if I take the multidimensional aspect out
of it and just use the format {'key':'value,'key':'value'}, it passes
just fine.  Also, if I specifically set the "method" to "get", I this
passed in $_GET

Array
(
    [{"anonymous_element_1":_
{"class":_"required",_"msg":_""},_"anonymous_element_2":_
{"class":_"required",_"msg":_""},_"public_phone":_
{"class":_"phone",_"value":_"706-201-1149",_"msg":_""},_"private_phone":_
{"class":_"phone",_"value":_"315-487-9176",_"msg":_""}}] =>
)

Basically a crazy URL-encoded version of my JSON, as the key in a
valueless array.  Hm.

What am I doing wrong here?  I just don't get it.

Thanks in advance!

Ian

--

You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.


Reply via email to