I love the cakephp framework, but I'm trying to create a primarily
javascript/ajax application.

Given the way cakephp assigns variables for its forms (ex data
[Inventory][name]), how can I submit this data in javascript/ajax and
parse it in the javascript so that it will end up as a valid hash
array in my controller?

The fields are being submitted as JSON strings currently:

"data[Inventory][name]"   =>  "Ladle"
"data[Inventory][type]"   =>  "Spoon"


Is there a way I can convert this inside the javascript before I
submit it via ajax so that once it gets to my controller I just have
to json_decode and it ends up as

$data['Inventory']['name'] = 'Ladle';

making it easy to save the data through $this->Inventory->save($this-
>data)?

I have no problem getting the data from the controller, it's posting
it to the controller that I can't get it in the cakephp convention
format without seemingly having to write a complicated parser that
would dissect the data[Inventory][name] strings into json objects.


Thanks very much!
Will

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to