首页 新闻 搜索 专区 学院

ASP.NET MVC +Jquery 应用JS 限制右边只能显示选择10项 功效

0
悬赏园豆:10 [已关闭问题] 关闭于 2015-12-01 18:10

应用JS 限制右边显示选择10项功能

 

 

 

   <div class="row">
                                            <div class="col-xs-5">
                                                <select name="from" id="multiselect" class="multi-select form-control" size="8" multiple="multiple">
                                                       @{
                                                           List<BasicEffect> basicEffecf = ViewBag.GetBasicEffectList;
                                                           if (basicEffecf != null)
                                                           {
                                                               foreach (var items in basicEffecf)
                                                               {
                                                                   if (items.DeleteFlag==false)
                                                                   {
                                                                    <option value="@items.ID" >@items.EffectName.ToString()</option>
                                                                   }

                                                               }
                                                           }
                                                    }
                                                </select>
                                            </div>
                                            <div class="col-xs-2">
                                                <button type="button" id="multiselect_rightAll" class="btn_1 default"><i class="glyphicon glyphicon-forward"></i></button>
                                                <button type="button" id="multiselect_rightSelected" class="btn_1 default"><i class="glyphicon glyphicon-chevron-right"></i></button>
                                                <button type="button" id="multiselect_leftSelected" class="btn_1 default"><i class="glyphicon glyphicon-chevron-left"></i></button>
                                                <button type="button" id="multiselect_leftAll" class="btn_1 default"><i class="glyphicon glyphicon-backward"></i></button>
                                            </div>
                                            <div class="col-xs-5">
                                                <select name="BasicEffect" id="multiselect_to"  class="multi-select form-control" size="8" multiple="multiple">
                                                
                                                
                                                </select>
                                                @Html.ValidationMessageFor(model=>model.BasicEffect,"",new { @class = "text-danger" })
                                            </div>
                                        </div>

LowKeyC的主页 LowKeyC | 初学一级 | 园豆:87
提问于:2015-11-30 11:36
< >
分享
所有回答(2)
0

foreach的时候给个长度不可以吗

默卿 | 园豆:4686 (老鸟四级) | 2015-12-01 00:05
0

自己已经解决了

LowKeyC | 园豆:87 (初学一级) | 2015-12-01 18:08
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册