在jquery中传递多个字符串 [英] pass more than one string in jquery

查看:103
本文介绍了在jquery中传递多个字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi Team,



我的Combobox如下:

Hi Team,

I have the Combobox as follows:

<select id="batchIDSelect" name="batchIDSelect" class="combo100" multiple="multiple">
                          <%--<option>Select </option>--%>
                      </select>





我很难在下面的代码中传递字符串。

我的页面上有Combobox:

组合框名称是BatchID。我在batchID中得到1,2,3的值。

如果我一次选择值1和2,所以我想要数据相关的BatchId 1和2.所以我怎么能通过这个在下面的代码中分隔的两个值逗号:



I am confused to pass string in following code .
I have the Combobox on my page:
Combo Box name is BatchID. I am getting the value as 1,2,3 in batchID.
If i select the value 1 and 2 at a time ,so i want data related BatchId 1 and 2 .So how can i pass this two values commas separated in below code :

qcAllocationDetails.BatchId = ($('#batchIDSelect').val() == '' ? 0 : $('#batchIDSelect').val());



如果你检查它给我的输出为12而不是1,2。我想要1,2之间的逗号。

我应该如何写逗号。



请指导我。

谢谢

Harshal


If you check it gives me the output as 12 not 1,2.I want commas between 1,2.
how should i put commas in it.

please guide me.
Thanks
Harshal

推荐答案

('#batchIDSelect')。val()==''? 0:
('#batchIDSelect').val() == '' ? 0 :


('#batchIDSelect')。val());
('#batchIDSelect').val());



如果检查它,输出为12不是1,2.我想要1,2之间的逗号。

我应该如何写逗号。



请指导我。

谢谢

Harshal


If you check it gives me the output as 12 not 1,2.I want commas between 1,2.
how should i put commas in it.

please guide me.
Thanks
Harshal


嗨Harshal,

请使用以下内容获得所需的结果。

Hi Harshal,
Please use following to get desired result.
qcAllocationDetails.BatchId =


这篇关于在jquery中传递多个字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆