开发者

How to pass the selected value from select box to a PHP function?

开发者 https://www.devze.com 2023-01-29 04:56 出处:网络
I have select box for company whose values are populated from DB and I also have another select box for department. Now I have a PHP function to get the values of department if we pass the id of compa

I have select box for company whose values are populated from DB and I also have another select box for department. Now I have a PHP function to get the values of department if we pass the id of company into it. I have to use this function to populate the department select box every i select the company name.

hence, How to pass the selected value from select box to a PHP function?

t开发者_运维百科hanx , every answer is appreciated.


Try looking at this: http://remysharp.com/2007/01/20/auto-populating-select-boxes-using-jquery-ajax/


You should use a js obviously, would have been helpful if you posted the code but write an

onchange="somefn()"

in the select box and write in the js function an ajax call to populate the second selectbox.

0

精彩评论

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

关注公众号