Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有什么理由选择的人口必须是动态的?数据是否发生变化,或者您只是让用户添加更多订单项以从预设选项中进行选择?
如果下拉列表中的数据本身是动态的,则需要结合使用 javascript 和 ajax 调用来实时从 php 获取数据。
如果选项不是动态的,那么您根本不需要 ajax,只需在 javascript 中填充变量并创建一个操作以使用已定义的变量添加更多下拉列表。