如何从列表框asp.net中选择多个项目,而无需使用javascript按下CTRL键? [英] How to select multiple items from a listbox asp.net without pressing the CTRL key using javascript?

查看:58
本文介绍了如何从列表框asp.net中选择多个项目,而无需使用javascript按下CTRL键?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在不使用javascript按下CTRL键的情况下从列表框中选择多个项目?

How to select multiple items from a listbox without pressing the CTRL key using javascript?

 <asp:ListBox ID="Satellites"  runat="server" AppendDataBoundItem="true" AutoPostBack="true"  onchange='GetValueSatellite();' Width="400px" SelectionMode="Multiple"></asp:ListBox>

推荐答案

$('option').mousedown(function (e) {
  e.preventDefault();
  $(this).prop('selected', $(this).prop('selected') ? false : true);
  return false;
 });

这篇关于如何从列表框asp.net中选择多个项目,而无需使用javascript按下CTRL键?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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