开发者

How do I name Ajax form fields to be recognized by CakePHP?

开发者 https://www.devze.com 2022-12-24 10:53 出处:网络
I want to submit a form via Ajax Javascript to a CakePHP funct开发者_JAVA技巧ion. CakePHP actions collect all form fields in $this->data. I want to convert my HTML form fields to the acceptable fo

I want to submit a form via Ajax Javascript to a CakePHP funct开发者_JAVA技巧ion.

CakePHP actions collect all form fields in $this->data. I want to convert my HTML form fields to the acceptable format i.e $this->data(array).

How to do this in Javascript? I'm using jQuery.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消