jQueryMobile:多项选择将所有值发送到服务器 [英] jQueryMobile: Multiple-Select sent all values to server
本文介绍了jQueryMobile:多项选择将所有值发送到服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在jQuery-Mobile中使用一个多选字段.但是,仅最后选择的值发送到服务器.这是我的代码:
I want to use a multiple-select field in jQuery-Mobile. However only the last selected value is sent to the server. This is my Code:
<select name="myValues"
data-native-menu="false" data-mini="true" multiple="multiple">
<option>Select one or more</option>
<?php
foreach ($propPosValues AS $posValue) {
<option value="<?= $field['Id'] ?>"><?= $field['Value'] ?></option>
<?php } ?>
</select>
不要理会php代码.它确实有效.用户界面显示在另一个窗口中打开的多项选择.但是,只有最后选择的值被发送到服务器.但是我显然想要所有人.
Don't bother about the php-code. It actually works. The UI shows a multiple-selects that opens in another window. But only the last selected-Value is sent to the server. But I obviously want all of them.
有什么建议吗?
推荐答案
名称标签必须为name ="myValues []". 方括号"[]"表示这是一个值数组.
The name-tag needs to be name="myValues[]". The brackets "[]" indicate, that this is an array of values.
这篇关于jQueryMobile:多项选择将所有值发送到服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文