views:

60

answers:

2

i want to submit a form via ajax javascript to cakephp function.

cakephp function accepts $this->data, so i want to convert html form datas to cakephp function acceptable format i.e $this->data(array)...

how to do this in javascript(jquery)

A: 

There is only one way to POST data, so the conversion must be done by cakephp.

Therefore however you submit a form, as long as it goes to the controller it should be automatically converted to $this->data.

adam
I don't think this is necessarily the case. You need to POST the data with the variable name starting as data. So, <input name="data[something]" > will end up in $data['something']. I may be wrong, but I don't think <input name="something"> will end up in Controller::data.
Travis Leleu
+1, think you may be right!
adam
A: 

no Travis Leleu, and adam its not working....

udhaya