开发者

Cakephp: cascading select boxes in a view

开发者 https://www.devze.com 2023-02-06 13:03 出处:网络
I need a form with cascading select boxes where the option selected in one affects the options contained in the other. Does anoyone have a sample code that implements this? Is开发者_C百科 it just a ma

I need a form with cascading select boxes where the option selected in one affects the options contained in the other. Does anoyone have a sample code that implements this? Is开发者_C百科 it just a matter of building ajax code into the .ctp file to repopulate the 2nd select control?

BTW, I'm using cake 1.3.7.


I would suggest to implement a special action for the second select box in your controller, that is called via ajax and just gets the data depending on the input

function get_second_sb_data($in) { .. }

and return a json object, to populate the other SB

0

精彩评论

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