dsh12544 2016-05-12 06:37
浏览 7
已采纳

选择在没有jquery的情况下获得多个选定值

In Chosen I get multi-selected values using the following code in jQuery -

$("chosen-selector").chosen().val()

But if I want to get these multiple selected values of select within a form via PHP it gives only single option value -

$multiple_values = $_REQUEST['chosen_select_name']

$multiple_values variable returns only a single value. How can I get multiple selected values using PHP.

  • 写回答

1条回答 默认 最新

  • douqiao1983 2016-05-12 06:54
    关注

    You need to make this field as array so that php can understand you will be passing multiple values. in html part make your field name from "chosen_select_name" to "chosen_select_name[]" and check the request.

    Multi select behavior works same as checkbox logic.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 正弦信号发生器串并联电路电阻无法保持同步怎么办
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 个人网站被恶意大量访问,怎么办
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)